PERS SDK - v2.3.26 / Exports / StaticJwtAuthProvider
Simple authentication provider for static JWT tokens No token storage, refresh, or DPoP - designed for server-side use
• new StaticJwtAuthProvider(config): StaticJwtAuthProvider
Create a static JWT auth provider
| Name | Type | Description |
|---|---|---|
config | StaticJwtAuthProviderConfig | Configuration with JWT, project key, and auth type |
core/auth/static-jwt-auth-provider.ts:55
• new StaticJwtAuthProvider(jwt, projectKey, authType?): StaticJwtAuthProvider
Create a static JWT auth provider (legacy constructor)
| Name | Type | Description |
|---|---|---|
jwt | string | Static JWT token |
projectKey | string | Project key |
authType? | AccountOwnerType | Authentication type (default: AccountOwnerType.BUSINESS) |
core/auth/static-jwt-auth-provider.ts:63
▸ getToken(): Promise<null | string>
Get the static JWT token
Promise<null | string>
The configured JWT token
core/auth/static-jwt-auth-provider.ts:94
▸ getProjectKey(): Promise<null | string>
Get project key for API requests
Promise<null | string>
The configured project key
PersAuthProvider.getProjectKey
core/auth/static-jwt-auth-provider.ts:102
▸ getAuthHeaders(token): Promise<Record<string, string>>
Get authentication headers (Bearer token) Note: No DPoP support for server-side static tokens
| Name | Type | Description |
|---|---|---|
token | null | string | The access token (ignored, uses configured JWT) |
Promise<Record<string, string>>
Headers with Bearer authorization
PersAuthProvider.getAuthHeaders
core/auth/static-jwt-auth-provider.ts:113
▸ onAuthStatusChange(status): Promise<void>
Handle authentication status changes
Note: Static JWTs cannot be refreshed automatically. TOKEN_EXPIRED status indicates manual JWT rotation is needed.
| Name | Type | Description |
|---|---|---|
status | AuthStatus | The new authentication status |
Promise<void>
PersAuthProvider.onAuthStatusChange
core/auth/static-jwt-auth-provider.ts:126
▸ clearTokens(): Promise<void>
Clear tokens (no-op for static provider) Static JWTs are immutable and managed externally
Promise<void>
core/auth/static-jwt-auth-provider.ts:144
• Readonly authType: AccountOwnerType
Authentication type