Narrow ctx.sessionKey from string | undefined to string. Use this in handlers that require session scoping so you don't litter ! assertions:
ctx.sessionKey
string | undefined
string
!
const sessionKey = requireSessionKey(ctx);const sessionStore = scopedStore(ctx.store, sessionKey); Copy
const sessionKey = requireSessionKey(ctx);const sessionStore = scopedStore(ctx.store, sessionKey);
Throws a SERVICE_UNAVAILABLE-style error if sessionKey is missing — typically meaning resolveSessionKey isn't configured or returned undefined for this tool.
SERVICE_UNAVAILABLE
sessionKey
resolveSessionKey
undefined
Narrow
ctx.sessionKeyfromstring | undefinedtostring. Use this in handlers that require session scoping so you don't litter!assertions:Throws a
SERVICE_UNAVAILABLE-style error ifsessionKeyis missing — typically meaningresolveSessionKeyisn't configured or returnedundefinedfor this tool.