new FirebaseAdapter(opts)
FirebaseAdapter class.
Method parameters:
Name | Type | Argument | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
Object |
<optional> |
Configuration opts. Properties
|
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 })