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

Readme

Keywords

none

Package Sidebar

Install

npm i cloud-datastore-session

Weekly Downloads

1

Version

0.1.0

License

none

Last publish

Collaborators

  • jdobry
  • jonparrott