prorm API Reference
    Preparing search index...

    Class SessionIsolation

    Index
    • Run a function within a specific tenant context.

      Type Parameters

      • T

      Parameters

      • tenantId: string

        The tenant ID to run in

      • fn: () => T

        The function to execute

      Returns T

      The result of the function

    • Register an encryption key for a tenant.

      Parameters

      • tenantId: string

        The tenant ID

      • key: string

        The encryption key (32 bytes recommended for AES-256)

      • OptionalkeyVersion: string

        Optional key version for rotation

      Returns Promise<void>

    • Get the encryption key for a tenant.

      Parameters

      • tenantId: string

        The tenant ID

      Returns Promise<TenantKey | undefined>

      The tenant key, or undefined if not found

    • Manually expire a session.

      Parameters

      • sessionId: string

        The session ID to expire

      Returns Promise<void>

    • Create a new session for a tenant.

      Parameters

      • tenantId: string

        The tenant ID

      • userId: string

        The user ID

      • Optionaloptions: { ipAddress?: string; userAgent?: string; customExpiresAt?: Date }

        Additional session options

      Returns Promise<SessionInfo>

      The created session info