createKvSessionStore
Sessions over a KV store.
Sessions over a KV store. The record is stored as JSON under <prefix><id> with the session's time to
live. Session data must be JSON (the memory session store copies with structuredClone; this adapter
requires JSON, which the store contract checks).
Import#
ts
import { createKvSessionStore } from "@shadow-js/dusk/server";
Signature#
ts
function createKvSessionStore(
kv: KVStore,
options: { readonly prefix?: string } = {},
): SessionStore
Parameters#
| Name | Description |
|---|---|
kv |
The store. |
options |
The prefix. |
Returns#
A SessionStore.