npm

Bring the best of OSS JavaScript development to your projects with npm Orgs - private packages & team management tools.Learn more »

cloud-datastore-session

0.1.0 • Public • Published

Google Cloud Datastore Sessions

cloud-datastore-session is a Express session storage backed by Google Cloud Datastore.

Note: Cloud Datastore is a persistent, distributed, transactional database. Often, it's more appropriate to choose a different storage solution for sessions such as Memcache or Redis as their designs offer much faster operation in this use case.

Installation

$ npm install --save cloud-datastore-session

Configuration

You must have a Google Cloud project and credentials. See gcloud node's documentation on setting up authorization.

Usage Example

var express = require('express');
var session = require('express-session');
var app = express();
 
var DatastoreStore = require('cloud-datastore-session')(session);
 
app.use(session({
  store: new DatastoreStore({
    dataset: gcloud.datastore.dataset({
        prefix: 'express-sessions',
        projectId: 'my-project-id',
        keyFilename: './key.json'
    }))
  }),
  secret: 'my-secret'
}));

Contributing changes

Licensing

Keywords

none

install

npm i cloud-datastore-session

Downloadsweekly downloads

2

version

0.1.0

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability