connect-surreal
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

connect-surrealdb

An express-session compatible store using SurrealDB as the backing database.

Sample usage:

import { SurrealDBStore } from 'connect-surreal';

app.use(session({
    secret: 'foobar',
    proxy: true,
    resave: false,
    saveUninitialized: false,
    cookie: {
        path: "/",
        sameSite: "lax",
        secure: true,    // May need to set app.set('trust proxy', 1) for this to work
        httpOnly: true,
        maxAge: 1000 * 60 * 60 * 24 * 1
    },
    store: new SurrealDBStore({
        url: "http://127.0.0.1:8000/rpc",
        signinOpts: {
            username: "root",
            password: "root"
        },
        connectionOpts: {
            namespace: "nodejs",
            database: "express",
        },
        tableName: "connect-surreal"
    }),
    unset: "destroy"
}));

Package Sidebar

Install

npm i connect-surreal

Weekly Downloads

2

Version

0.0.2

License

MIT

Unpacked Size

7.66 kB

Total Files

5

Last publish

Collaborators

  • knackstedt