แอป Firebase มีข้อมูลการเริ่มต้นสำหรับคอลเล็กชันของบริการ
ลายเซ็น:
export interface App
พร็อพเพอร์ตี้
พร็อพเพอร์ตี้ | ประเภท | คำอธิบาย |
---|---|---|
name | string | ชื่อ (อ่านอย่างเดียว) ของแอปนี้ชื่อแอปเริ่มต้นคือ "[DEFAULT]" |
ตัวเลือก | ตัวเลือกแอป | ตัวเลือกการกำหนดค่า (อ่านอย่างเดียว) สำหรับแอปนี้ พารามิเตอร์ดั้งเดิมที่ระบุไว้ใน initializeApp() |
ชื่อแอปพลิเคชัน
ชื่อ (อ่านอย่างเดียว) สำหรับแอปนี้
ชื่อแอปเริ่มต้นคือ "[DEFAULT]"
ลายเซ็น:
name: string;
ตัวอย่าง 1
// The default app's name is "[DEFAULT]"
initializeApp(defaultAppConfig);
console.log(admin.app().name); // "[DEFAULT]"
ตัวอย่าง 2
// A named app's name is what you provide to initializeApp()
const otherApp = initializeApp(otherAppConfig, "other");
console.log(otherApp.name); // "other"
App.options
ตัวเลือกการกำหนดค่า (อ่านอย่างเดียว) สำหรับแอปนี้ พารามิเตอร์ดั้งเดิมที่ระบุไว้ใน initializeApp()
ลายเซ็น:
options: AppOptions;
ตัวอย่าง
const app = initializeApp(config);
console.log(app.options.credential === config.credential); // true
console.log(app.options.databaseURL === config.databaseURL); // true