Giter VIP home page Giter VIP logo

connect-firebase's Introduction

Connect Firebase

connect-firebase is a Firebase session store backed by the firebase sdk

NPM NPM

Installation

  $ npm install connect-firebase

Options

  • host An existing Firebase to store sessions
  • token (optional) A Firebase authentication token
  • reapInterval (optional) how often expired sessions should be cleaned up (defaults to 21600000) (6 hours in milliseconds)

Usage

var options = {

  // The URL you were given when you created your Firebase
  host: 'connect-sessions.firebaseio.com',

  // Optional. A Firebase authentication token
  token: 'qKtOKAQSTCxLFJI7uSeof6H7cfLpSuWYOhqOTQqz',

  // Optional. How often expired sessions should be cleaned up.
  // Defaults to 21600000 (6 hours).
  reapInterval: 600000

};

var connect = require('connect'),
  FirebaseStore = require('connect-firebase')(connect);
connect()
  .use(connect.cookieParser())
  .use(connect.session({ store: new FirebaseStore(options), secret: 'keyboard cat'}))

Or with express

NOTE: Due to express 4.x.x changes, we now need to pass express-session to the function connect-firebase exports in order to extend express-session.Store:

var session = require('express-session'),
  FirebaseStore = require('connect-firebase')(session);
app.use(session({
  store: new FirebaseStore(options), 
  secret: 'keyboard cat' 
}));

License

connect-firebase is licensed under the MIT license.

connect-firebase's People

Contributors

acolby avatar fpereira1 avatar snowyu avatar zetorama avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.