express-ts-session-firestore
v0.0.1-beta.3
Published
Firestore session storage class for Express TS Session
Downloads
7
Maintainers
Readme
Express TS Session Firestore Store
This is an extension to the Store class in Express TS Session to manage session data in Firestore.
Installation
npm install express-ts-session-firestore
Usage
import { ExpressTSSession, Cookie } from "express-ts-sesion";
import express from 'express';
import FirestoreStore from 'express-ts-session-firestore';
import { Firestore } from '@google-cloud/firestore';
const sessionMiddleware = new ExpressTSSession({
name: "my-app"
secret: "mysecret",
cookie: new Cookie({
maxAge: 1000 * 60 * 60 * 24 * 7,
secure: false,
httpOnly: true,
path: "/",
sameSite: false,
signed: true,
}),
store: new FirestoreStore({ database: new Firestore() }),
});
const app = express();
app.use(sessionMiddleware.init);