Skip to content

Browsers

Thiago Delgado Pinto edited this page Dec 13, 2017 · 2 revisions

To use database-js in the browser, require the driver manually and pass it as a second argument to the Connection. This causes database-js to ignore the driver in the connection URL. This can also be useful during driver development.

var Database = require('database-js2').Connection;
var firebaseDriver = require('database-js-firebase');

var connection = new Database('firebase://[email protected]:password@statesdemo/ewJviY6wboTKJ57A2dZkvq8kxYo1?apiKey=AIzaSyD1ypTmnJb_d8ZOyfc-KBMe0tw8owYCwjA', firebaseDriver);