Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
DynamoDB session store for Connect
JavaScript Makefile
branch: master
Failed to load latest commit information.
lib happy new year
test change tests to mocha
.gitignore happy new year
History.md bump version
LICENSE.txt happy new year
Makefile using aws-sdk instead of dynode
README.md Update README.md
index.js first push
package.json bump version

README.md

Connect DynamoDB

connect-dynamodb is a DynamoDB session store backed by the aws-sdk

NPM NPM

Installation

  $ npm install connect-dynamodb

Options

  • client An existing AWS DynamoDB object you normally get from new AWS.DynamoDB()
  • AWSConfigPath Optional path to JSON document containing your AWS credentials (defaults to loading credentials from environment variables)
  • AWSRegion Optional AWS region (defaults to 'us-east-1')
  • table Optional DynamoDB server session table name (defaults to "sessions", currently the hash key has to be id - see issue #14)
  • prefix Optional key prefix (defaults to "sess")
  • reapInterval Optional - how often expired sessions should be cleaned up (defaults to 600000)

Usage

var options = {
    // Name of the table you would like to use for sessions.
    // Defaults to 'sessions'
    table: 'myapp-sessions',

    // Optional path to AWS credentials (loads credentials from environment variables by default)
    // AWSConfigPath: './path/to/credentials.json',

    // Optional. How often expired sessions should be cleaned up.
    // Defaults to 600000 (10 minutes).
    reapInterval: 600000
};

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

Or with express 3.x.x

DynamoDBStore = require('connect-dynamodb')(express);
var app = express(
    express.cookieParser(), 
    express.session({ store: new DynamoDBStore(options), secret: 'keyboard cat'})
);

Or with express 4.x.x

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

Contributors

Some people that have added features and fixed bugs in connect-dynamodb other than me.

Thanks!

License

connect-dynamodb is licensed under the MIT license.

Donations

I made this in my spare time, so if you find it useful you can donate at my BTC address: 13Bzg4reJJt43wU1QsPSCzyFZMLhJbRELA. Thank you very much!

Something went wrong with that request. Please try again.