@authx-rs/sdk
Generated from packages/authx-sdk-ts/dist/types.
Low-level OIDC, JWKS, PKCE, device, and browser-session helpers.
Modules
Section titled “Modules”device
Section titled “device”DeviceAuthorizationResponse
Section titled “DeviceAuthorizationResponse”export interface DeviceAuthorizationResponse { device_code: string; user_code: string; verification_uri: string; verification_uri_complete?: string; expires_in: number; interval: number; [key: string]: unknown;}DeviceAuthorizationOptions
Section titled “DeviceAuthorizationOptions”export interface DeviceAuthorizationOptions { endpoint: string; clientId: string; scope?: string;}PollDeviceTokenOptions
Section titled “PollDeviceTokenOptions”export interface PollDeviceTokenOptions { tokenEndpoint: string; clientId: string; deviceCode: string; clientSecret?: string;}startDeviceAuthorization
Section titled “startDeviceAuthorization”export declare function startDeviceAuthorization(options: DeviceAuthorizationOptions): Promise<DeviceAuthorizationResponse>;pollDeviceToken
Section titled “pollDeviceToken”export declare function pollDeviceToken(options: PollDeviceTokenOptions): Promise<OidcTokenResponse>;errors
Section titled “errors”AuthxErrorBody
Section titled “AuthxErrorBody”export interface AuthxErrorBody { error?: string; message?: string; error_description?: string; [key: string]: unknown;}AuthxSdkError
Section titled “AuthxSdkError”export declare class AuthxSdkError extends Error { readonly status?: number; readonly code?: string; readonly details?: unknown; constructor(message: string, options?: { status?: number; code?: string; details?: unknown; });}toAuthxSdkError
Section titled “toAuthxSdkError”export declare function toAuthxSdkError(message: string, options?: { status?: number; code?: string; details?: unknown;}): AuthxSdkError;JwtHeader
Section titled “JwtHeader”export interface JwtHeader { alg?: string; typ?: string; kid?: string; [key: string]: unknown;}OidcJwk
Section titled “OidcJwk”export interface OidcJwk extends JsonWebKey { kid?: string; use?: string; alg?: string; kty: string; x5c?: string[]; [key: string]: unknown;}JwksDocument
Section titled “JwksDocument”export interface JwksDocument { keys: OidcJwk[]; [key: string]: unknown;}SelectJwkOptions
Section titled “SelectJwkOptions”export interface SelectJwkOptions { kid?: string; alg?: string; use?: string; kty?: string;}fetchJwks
Section titled “fetchJwks”export declare function fetchJwks(jwksUri: string): Promise<JwksDocument>;fetchIssuerJwks
Section titled “fetchIssuerJwks”export declare function fetchIssuerJwks(issuer: string): Promise<JwksDocument>;decodeJwtHeader
Section titled “decodeJwtHeader”export declare function decodeJwtHeader(token: string): JwtHeader;selectJwk
Section titled “selectJwk”export declare function selectJwk(jwks: JwksDocument, options: SelectJwkOptions): OidcJwk | undefined;getJwkForJwt
Section titled “getJwkForJwt”export declare function getJwkForJwt(jwks: JwksDocument, token: string): OidcJwk | undefined;OidcDiscoveryDocument
Section titled “OidcDiscoveryDocument”export interface OidcDiscoveryDocument { issuer: string; authorization_endpoint: string; token_endpoint: string; userinfo_endpoint?: string; jwks_uri?: string; revocation_endpoint?: string; introspection_endpoint?: string; device_authorization_endpoint?: string; token_endpoint_auth_methods_supported?: string[]; response_types_supported?: string[]; grant_types_supported?: string[]; scopes_supported?: string[]; id_token_signing_alg_values_supported?: string[]; [key: string]: unknown;}OidcTokenResponse
Section titled “OidcTokenResponse”export interface OidcTokenResponse { access_token: string; token_type: string; expires_in: number; refresh_token?: string; scope?: string; id_token?: string; [key: string]: unknown;}IntrospectionResponse
Section titled “IntrospectionResponse”export interface IntrospectionResponse { active: boolean; scope?: string; client_id?: string; username?: string; token_type?: string; exp?: number; iat?: number; sub?: string; iss?: string; [key: string]: unknown;}BuildAuthorizationUrlOptions
Section titled “BuildAuthorizationUrlOptions”export interface BuildAuthorizationUrlOptions { authorizationEndpoint: string; clientId: string; redirectUri: string; scope?: string; state?: string; nonce?: string; codeChallenge?: string; codeChallengeMethod?: "S256"; extraParams?: Record<string, string | undefined>;}ExchangeCodeOptions
Section titled “ExchangeCodeOptions”export interface ExchangeCodeOptions { tokenEndpoint: string; clientId: string; code: string; redirectUri: string; codeVerifier?: string; clientSecret?: string;}RefreshTokenOptions
Section titled “RefreshTokenOptions”export interface RefreshTokenOptions { tokenEndpoint: string; clientId: string; refreshToken: string; scope?: string; clientSecret?: string;}RevokeTokenOptions
Section titled “RevokeTokenOptions”export interface RevokeTokenOptions { revocationEndpoint: string; clientId: string; token: string; tokenTypeHint?: string; clientSecret?: string;}IntrospectTokenOptions
Section titled “IntrospectTokenOptions”export interface IntrospectTokenOptions { introspectionEndpoint: string; clientId: string; token: string; tokenTypeHint?: string; clientSecret?: string;}UserInfoClaims
Section titled “UserInfoClaims”export interface UserInfoClaims { sub: string; email?: string; email_verified?: boolean; preferred_username?: string; [key: string]: unknown;}discoverIssuer
Section titled “discoverIssuer”export declare function discoverIssuer(issuer: string): Promise<OidcDiscoveryDocument>;buildAuthorizationUrl
Section titled “buildAuthorizationUrl”export declare function buildAuthorizationUrl(options: BuildAuthorizationUrlOptions): string;exchangeAuthorizationCode
Section titled “exchangeAuthorizationCode”export declare function exchangeAuthorizationCode(options: ExchangeCodeOptions): Promise<OidcTokenResponse>;refreshToken
Section titled “refreshToken”export declare function refreshToken(options: RefreshTokenOptions): Promise<OidcTokenResponse>;revokeToken
Section titled “revokeToken”export declare function revokeToken(options: RevokeTokenOptions): Promise<void>;introspectToken
Section titled “introspectToken”export declare function introspectToken(options: IntrospectTokenOptions): Promise<IntrospectionResponse>;fetchUserInfo
Section titled “fetchUserInfo”export declare function fetchUserInfo(userInfoEndpoint: string, accessToken: string): Promise<UserInfoClaims>;PkcePair
Section titled “PkcePair”export interface PkcePair { codeVerifier: string; codeChallenge: string; codeChallengeMethod: "S256";}randomString
Section titled “randomString”export declare function randomString(byteLength?: number): string;createPkcePair
Section titled “createPkcePair”export declare function createPkcePair(byteLength?: number): Promise<PkcePair>;randomState
Section titled “randomState”export declare function randomState(byteLength?: number): string;session
Section titled “session”SessionUser
Section titled “SessionUser”export interface SessionUser { id?: string; user_id?: string; email?: string; email_verified?: boolean; username?: string | null; [key: string]: unknown;}SessionRecord
Section titled “SessionRecord”export interface SessionRecord { id?: string; session_id?: string; user_id?: string; ip_address?: string; org_id?: string | null; expires_at?: string; created_at?: string; [key: string]: unknown;}SignInResult
Section titled “SignInResult”export interface SignInResult { user_id: string; session_id: string; token: string; [key: string]: unknown;}SignUpResult
Section titled “SignUpResult”export interface SignUpResult { user_id: string; email: string; [key: string]: unknown;}SessionEnvelope
Section titled “SessionEnvelope”export interface SessionEnvelope { user?: SessionUser; session?: SessionRecord; [key: string]: unknown;}BrowserSessionClientOptions
Section titled “BrowserSessionClientOptions”export interface BrowserSessionClientOptions { baseUrl: string; credentials?: RequestCredentials; headers?: HeadersInit;}CredentialInput
Section titled “CredentialInput”export interface CredentialInput { email: string; password: string;}BrowserSessionClient
Section titled “BrowserSessionClient”export declare class BrowserSessionClient { constructor(options: BrowserSessionClientOptions); signUp(body: CredentialInput): Promise<SignUpResult>; signIn(body: CredentialInput): Promise<SignInResult>; signOut(): Promise<void>; signOutAll(): Promise<void>; session(): Promise<SessionEnvelope>; sessions(): Promise<SessionRecord[]>;}