createCanvasStorage
Assembles an environment's storage surface from its declaration and the host's backends, seeding the session state when the slot is empty.
@internote/canvas-sdkOn this page
import { createCanvasStorage } from '@internote/canvas-sdk';What the headless host calls when it mounts an environment. A custom host building contexts of its own calls it the same way.
#Signature
<S = unknown>(
declaration: CanvasStorageDeclaration | undefined,
session: EnvironmentSessionState<S>,
db?: KeyValueStorage,
): CanvasStorage<S>#Parameters
declarationThe definition's
storage field, or undefined for the session tier alone.sessionThe environment's slot in the host's session store.
dbThe host's durable store. Handed on only when the declaration asks for
session+db.Declared in packages/canvas-sdk/src/storage/index.ts:94.