Class: FirebaseAdapter

js-data-firebase~ FirebaseAdapter


new FirebaseAdapter(opts)

FirebaseAdapter class.

Method parameters:
Name Type Argument Description
opts Object <optional>

Configuration opts.

Properties
Name Type Argument Default Description
db Object <optional>

See FirebaseAdapter#db

debug Boolean <optional>
false

See Adapter#debug.

raw Boolean <optional>
false

See Adapter#raw.

Details
Source
src/index.js, line 58
Examples

import {DataStore} from 'js-data'
import firebase from 'firebase'
import {FirebaseAdapter} from 'js-data-firebase'
const store = new DataStore()
firebase.initializeApp({
  apiKey: 'your-api-key',
  databaseURL: 'your-database-url'
})
const adapter = new FirebaseAdapter({ db: firebase.database() })
store.registerAdapter('firebase', adapter, { 'default': true })

import {Container} from 'js-data'
import firebase from 'firebase'
import {FirebaseAdapter} from 'js-data-firebase'
const store = new Container()
firebase.initializeApp({
  databaseURL: 'your-database-url',
  serviceAccount: 'path/to/keyfile'
})
const adapter = new FirebaseAdapter({ db: firebase.database() })
store.registerAdapter('firebase', adapter, { 'default': true })