Sporades SDK API
    Preparing search index...

    Type Alias CapsuleDefinition<Schema>

    Top-level Capsule definition passed to capsule().

    The Capsule is the deployable unit: schema, server handlers, middleware, and hooks bundled with the client, config, and runtime data boundary.

    type CapsuleDefinition<Schema extends SchemaDefinition = SchemaDefinition> = {
        emailEvents?: EmailEventDefinition<EmailEventHandler<Schema>>;
        endpoints?: Record<string, EndpointDefinition<EndpointHandler<Schema>>>;
        files?: CapsuleFilesDefinition;
        hooks?: CapsuleHooks<Schema>;
        jobs?: Record<string, JobDefinition>;
        journey?: {
            capture?: {
                focus?: boolean;
                interactions?: boolean;
                navigation?: boolean;
            };
            enabled: true;
            ttlSeconds?: number;
        };
        messages?: Record<string, MessageDefinition<MessageHandler<Schema>>>;
        middleware?: ContextMiddleware<Schema>[];
        mutations?: Record<string, MutationDefinition>;
        name: string;
        queries?: Record<string, QueryDefinition<QueryHandler<Schema>>>;
        schedules?: Record<string, ScheduleDefinition>;
        schema?: Schema;
        teams?: { appRoles?: readonly string[] };
    }

    Type Parameters

    Index
    endpoints?: Record<string, EndpointDefinition<EndpointHandler<Schema>>>

    Optional File ACL rules for deliberate non-owner access to normal File operations. File ownership and public-URL revocation remain with the File owner.

    jobs?: Record<string, JobDefinition>
    journey?: {
        capture?: {
            focus?: boolean;
            interactions?: boolean;
            navigation?: boolean;
        };
        enabled: true;
        ttlSeconds?: number;
    }

    Enable the client-only Journey tracker and define its TTL and automatic-capture ceiling.

    messages?: Record<string, MessageDefinition<MessageHandler<Schema>>>
    middleware?: ContextMiddleware<Schema>[]
    mutations?: Record<string, MutationDefinition>
    name: string
    queries?: Record<string, QueryDefinition<QueryHandler<Schema>>>
    schedules?: Record<string, ScheduleDefinition>
    schema?: Schema
    teams?: { appRoles?: readonly string[] }

    Up to 32 Capsule-specific membership roles. Each must match ^[a-z][a-z0-9-]{0,31}$ (maximum 32 characters); admin, member, and sporades-* remain runtime-reserved.