Skip to main content
The only change you need is the databaseURL in your Firebase config. Here’s a typical config object. The highlighted line is the only thing you change:
var firebaseConfig = {
  apiKey: "API_KEY",
  authDomain: "PROJECT_ID.firebaseapp.com",
  // Change this from https://PROJECT_ID.firebaseio.com
  databaseURL: "https://your-lark-project-id.larkdb.net",
  projectId: "PROJECT_ID",
  storageBucket: "PROJECT_ID.firebasestorage.app",
  messagingSenderId: "SENDER_ID",
  appId: "APP_ID",
  measurementId: "G-MEASUREMENT_ID",
};

Firebase JS SDK v8

import firebase from 'firebase/app';
import 'firebase/database';

firebase.initializeApp({
  databaseURL: 'https://your-lark-project-id.larkdb.net'
});

const db = firebase.database();

Firebase JS SDK v9 (modular)

import { initializeApp } from 'firebase/app';
import { getDatabase, ref, set } from 'firebase/database';

const app = initializeApp({
  databaseURL: 'https://your-lark-project-id.larkdb.net'
});

const db = getDatabase(app);

Database routing

If your Firebase app stores many independent data silos under path prefixes (game rooms, workspaces, etc.), see Database routing for options on splitting them into separate Lark databases.