Practic Passkey - v1.0.0
    Preparing search index...

    Type Alias PasskeyServer

    The passkey server: one function from a request body to a result, for any transport to call.

    type PasskeyServer = {
        admin: (request: PasskeyAdminRequestInput) => Promise<PasskeyResult>;
        allowsOrigin: (origin: string, context: PasskeyContext) => Promise<boolean>;
        process: (body: Json, context: PasskeyContext) => Promise<PasskeyResult>;
        session: (
            request: PasskeySessionRequest,
        ) => Promise<PasskeySessionInfo | undefined>;
    }
    Index
    admin: (request: PasskeyAdminRequestInput) => Promise<PasskeyResult>

    Run an admin action from the server's own code, such as a seed script, with no key or session; the same answers as the endpoint gives.

    allowsOrigin: (origin: string, context: PasskeyContext) => Promise<boolean>

    Whether a page on another origin may call the endpoint, for a CORS preflight, which names no app: when any app lists the origin, or it is on the request's own host name. Each action is then held to its own app's origins.

    process: (body: Json, context: PasskeyContext) => Promise<PasskeyResult>

    Processes an action. Takes the request body as parsed JSON, and never throws for a bad request: refusals come back as results with a 4xx status.

    session: (
        request: PasskeySessionRequest,
    ) => Promise<PasskeySessionInfo | undefined>

    The signed-in account and passkey of a request, or undefined without a live session: for the app's own routes, such as await passkey.session({ cookie: request.headers.get('cookie') ?? undefined }).