1.1.2 • Published 4 months ago

connect-surreal v1.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

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"
    }),
    genid: () => ulid() // !Important: IDs cannot contain dashes
    unset: "destroy"
}));
1.1.2

4 months ago

1.1.1

5 months ago

1.1.0

5 months ago

1.0.3

8 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

10 months ago

0.0.2

1 year ago

0.0.1

1 year ago

0.0.0

1 year ago