PERS SDK - v2.3.26 / Exports
- AnalyticsApi
- AnalyticsService
- ApiKeyApi
- BookingApi
- BookingService
- BusinessApi
- BusinessMembershipApi
- BusinessMembershipService
- BusinessService
- CampaignApi
- CampaignService
- AuthApi
- DefaultAuthProvider
- DPoPManager
- WebDPoPCryptoProvider
- IndexedDBTokenStorage
- AuthService
- StaticJwtAuthProvider
- LocalStorageTokenStorage
- MemoryTokenStorage
- AuthTokenManager
- CacheService
- ErrorUtils
- TokenRefreshNeeded
- ProviderTokenRefreshNeeded
- LogoutRequired
- PersApiError
- AuthenticationError
- NetworkError
- PersEventEmitter
- PersApiClient
- TrackingManager
- DonationApi
- DonationService
- PersEventsClient
- FileApi
- FileService
- ApiKeyManager
- DonationManager
- WalletEventsManager
- TenantManager
- UserStatusManager
- NotificationApi
- PaymentApi
- PaymentService
- AngularHttpClientAdapter
- BrowserFetchClientAdapter
- NodeHttpClientAdapter
- RedemptionApi
- RedemptionService
- TenantApi
- TenantService
- TokenApi
- BaseTokenService
- TokenService
- TokenSDK
- TransactionApi
- TransactionService
- TriggerSourceApi
- TriggerSourceService
- UserStatusApi
- UserStatusService
- UserApi
- UserService
- WebhookApi
- isFatalAuthErrorInMessage
- detectWebPlatform
- detectEnvironment
- warnIfProblematicEnvironment
- buildApiRoot
- buildWalletEventsWsUrl
- mergeWithDefaults
- createPersEventsClient
- createPersSDK
- buildImageUrl
- isIpfsUrl
- extractIpfsCid
- isPaginatedResponse
- extractData
- extractPagination
- normalizeToPaginated
- fetchAllPages
- getMetadataFromTokenUnitResponse
- needsExternalSigning
- needsSubmission
- getSigningUrl
- extractDeadlineFromSigningData
- buildPendingTransactionData
- buildMintRequest
- buildBurnRequest
- buildTransferRequest
- buildSubmissionRequest
- buildPOSTransferRequest
- buildPOSBurnRequest
- createUserStatusSDK
- BookingValidationOptions
- BookingQueryOptions
- GetBusinessMembersOptions
- HttpClient
- RequestOptions
- HttpResponse
- BusinessAuthOptions
- TenantAuthOptions
- PersAuthProvider
- TokenStorageProvider
- ExtendedTokenStorageProvider
- AuthConfig
- DPoPManagerCallbacks
- DPoPKeyPair
- DPoPProofOptions
- DPoPCryptoProvider
- RawUserData
- StaticJwtAuthProviderConfig
- TokenStorage
- CacheConfig
- EnvironmentInfo
- SuccessEvent
- ErrorEvent
- EventFilter
- PersConfig
- NotificationContext
- EventsClientConfig
- SignedUrlRequest
- SignedPutUrlRequest
- SignedUrlResponse
- FileOptimizeRequest
- FileOptimizeResponse
- CustomFieldQueryOptions
- WalletEventsConfig
- NotificationQueryOptions
- PaymentIntentUpdateDTO
- ApiResponse
- PaginationWithFilters
- TokenMetadata
- PendingTransactionParams
- POSAuthorizationOptions
- TriggerSourceQueryOptions
- UserPublicProfileDTO
- WebhookTriggerRequest
- WebhookQueryOptions
- WebhookExecutionQueryOptions
- CampaignClaimFilters
- CampaignClaimQueryOptions
- CampaignFilterOptionsWithInclude
- CampaignFilterOptions
- SdkErrorCode
- NotificationLevel
- EventDetails
- AuthEventType
- TransactionEventType
- CampaignEventType
- RedemptionEventType
- NotificationEventType
- KnownEventType
- PersEvent
- EventHandler
- Unsubscribe
- AnyDomain
- SuccessEventInput
- ErrorEventInput
- PersEnvironment
- PersApiVersion
- NotificationPendingHandler
- RedemptionRedeemFilters
- RedemptionRedeemQueryOptions
- RedemptionFilterOptionsWithInclude
- ListResponse
- TokenMetadataQueryOptions
- RewardsFilterOptions
- StampsFilterOptions
- TransactionQueryOptions
- ClientTransactionType
- UserStatusSDK
- UserQueryOptions
- DPOP_STORAGE_KEYS
- FATAL_AUTH_CODES
- AUTH_STORAGE_KEYS
- globalCacheService
- CacheTTL
- environment
- SdkErrorCodes
- ApiErrorDetector
- DEFAULT_PERS_CONFIG
- SDK_NAME
- SDK_VERSION
- SDK_USER_AGENT
- ClientTransactionType
▸ isFatalAuthErrorInMessage(message): boolean
Check if an error message contains any fatal auth error code. Useful for detecting fatal errors in wrapped/stringified errors.
| Name | Type |
|---|---|
message | string |
boolean
core/auth/services/auth-service.ts:53
▸ detectWebPlatform(): Platform
Detect web platform from User-Agent (browser environments only)
This uses navigator.userAgent which is only available in browsers. For Node.js or React Native, use platform-specific detection.
Platform
Example
const platform = detectWebPlatform();
sdk.setPlatform(platform);
// { os: 'macOS', browser: 'Chrome', browserVersion: '125.0', deviceType: 'desktop' }▸ detectEnvironment(): EnvironmentInfo
Detects the current runtime environment
▸ warnIfProblematicEnvironment(feature): void
Warns if environment might have bundling issues
| Name | Type |
|---|---|
feature | string |
void
▸ buildApiRoot(environment?, version?, customApiUrl?): string
Build the API root URL based on config
Priority:
- customApiUrl (if provided)
- Environment-based URL (staging/production)
| Name | Type | Default value |
|---|---|---|
environment | PersEnvironment | 'production' |
version | "v2" | 'v2' |
customApiUrl? | string | undefined |
string
▸ buildWalletEventsWsUrl(environment?, customWsUrl?): string
Build wallet events WebSocket URL based on config
| Name | Type | Default value |
|---|---|---|
environment | PersEnvironment | 'production' |
customWsUrl? | string | undefined |
string
▸ mergeWithDefaults(config): PersConfig & Required<Pick<PersConfig, "environment" | "apiVersion" | "timeout" | "retries">>
Merge user config with defaults
| Name | Type |
|---|---|
config | PersConfig |
PersConfig & Required<Pick<PersConfig, "environment" | "apiVersion" | "timeout" | "retries">>
▸ createPersEventsClient(config): PersEventsClient
Create a PERS Events client instance
| Name | Type |
|---|---|
config | EventsClientConfig |
events/pers-events-client.ts:609
▸ createPersSDK(httpClient, config): PersSDK
Factory function for creating PERS SDK
| Name | Type | Description |
|---|---|---|
httpClient | HttpClient | Platform-specific HTTP client implementation |
config | PersConfig | SDK configuration options |
PERS SDK instance
▸ buildImageUrl(url, options?, gateway?): string
Build optimized image URL with automatic IPFS resolution and CDN options
Single entry point for all image URL building:
- IPFS URIs → resolved via gateway + CDN options applied
- HTTP URLs → CDN options applied directly
| Name | Type | Description |
|---|---|---|
url | string | Image URL (ipfs://, https://, or any URL) |
options? | ImageCdnOptions | CDN optimization options (preset, quality, format, fit) |
gateway? | string | IPFS gateway domain (required for ipfs:// URLs) |
string
Optimized URL with query parameters
Example
// IPFS thumbnail
buildImageUrl('ipfs://QmHash', { preset: 'thumb' }, 'cdn.example.com')
// => 'https://cdn.example.com/ipfs/QmHash?preset=thumb'
// IPFS hero with high quality
buildImageUrl('ipfs://QmHash', { preset: 'hero', q: 95, fit: 'cover' }, 'cdn.example.com')
// => 'https://cdn.example.com/ipfs/QmHash?preset=hero&q=95&fit=cover'
// HTTP URL (gateway ignored)
buildImageUrl('https://example.com/photo.jpg', { preset: 'card' })
// => 'https://example.com/photo.jpg?preset=card'
// No options - just IPFS resolution
buildImageUrl('ipfs://QmHash', undefined, 'cdn.example.com')
// => 'https://cdn.example.com/ipfs/QmHash'shared/utils/image-url-utils.ts:73
▸ isIpfsUrl(url): boolean
Check if a URL is an IPFS URI
| Name | Type | Description |
|---|---|---|
url | string | URL to check |
boolean
True if URL starts with ipfs://
shared/utils/image-url-utils.ts:102
▸ extractIpfsCid(ipfsUri): string | null
Extract CID from IPFS URI
| Name | Type | Description |
|---|---|---|
ipfsUri | string | IPFS URI (ipfs://Qm... or ipfs://baf...) |
string | null
CID string, or null if not a valid IPFS URI
Example
extractIpfsCid('ipfs://QmHash123')
// => 'QmHash123'
extractIpfsCid('https://example.com/image.jpg')
// => nullshared/utils/image-url-utils.ts:121
▸ isPaginatedResponse<T>(response): response is PaginatedResponseDTO<T>
Type guard to check if response is paginated
| Name |
|---|
T |
| Name | Type | Description |
|---|---|---|
response | PaginatedResponseDTO<T> | T[] | Either an array or paginated response |
response is PaginatedResponseDTO<T>
True if response is PaginatedResponseDTO
Example
const response = await api.getItems();
if (isPaginatedResponse(response)) {
console.log(response.pagination.total);
}shared/utils/pagination-utils.ts:69
▸ extractData<T>(response): T[]
Extract data array from either array or paginated response Use during hybrid backend phase to safely handle both response shapes
| Name |
|---|
T |
| Name | Type | Description |
|---|---|---|
response | PaginatedResponseDTO<T> | T[] | Either an array or paginated response |
T[]
Data array
Example
const response = await api.getItems(); // Could be T[] or PaginatedResponseDTO<T>
const items = extractData(response); // Always T[]shared/utils/pagination-utils.ts:94
▸ extractPagination<T>(response): PaginatedResponseDTO<T>["pagination"] | null
Extract pagination metadata (returns null for array responses)
| Name |
|---|
T |
| Name | Type | Description |
|---|---|---|
response | PaginatedResponseDTO<T> | T[] | Either an array or paginated response |
PaginatedResponseDTO<T>["pagination"] | null
Pagination metadata or null
Example
const response = await api.getItems();
const pagination = extractPagination(response);
if (pagination) {
console.log(`Total: ${pagination.total}`);
}shared/utils/pagination-utils.ts:116
▸ normalizeToPaginated<T>(response): PaginatedResponseDTO<T>
Normalize any list response to PaginatedResponseDTO format Converts array responses to paginated format during hybrid backend phase
| Name |
|---|
T |
| Name | Type | Description |
|---|---|---|
response | PaginatedResponseDTO<T> | T[] | Either an array or paginated response |
PaginatedResponseDTO<T>
Paginated response (normalized if input was array)
Example
// Backend returns array (no pagination params)
const arrayResponse = await api.getItems();
const normalized = normalizeToPaginated(arrayResponse);
console.log(normalized.data); // Original array
console.log(normalized.pagination); // Generated metadata
// Backend returns paginated (with pagination params)
const paginatedResponse = await api.getItems({ page: 1, limit: 50 });
const normalized2 = normalizeToPaginated(paginatedResponse);
console.log(normalized2); // Same as input (no conversion needed)shared/utils/pagination-utils.ts:143
▸ fetchAllPages<T>(fetchFn, limit?, maxPages?): Promise<T[]>
Fetch all pages automatically (useful for infinite scroll or complete datasets)
⚠️ WARNING: Use with caution on large datasets. This will make multiple API calls and load all items into memory. Consider using pagination UI instead.
| Name |
|---|
T |
| Name | Type | Default value | Description |
|---|---|---|---|
fetchFn | (page: number, limit: number) => Promise<PaginatedResponseDTO<T>> | undefined | Function that fetches a page (must return PaginatedResponseDTO) |
limit | number | DEFAULT_PAGE_SIZE | Items per page (default: 50) |
maxPages | number | 100 | Safety limit to prevent infinite loops (default: 100) |
Promise<T[]>
All items from all pages
Example
// Fetch all campaigns (use with caution!)
const allCampaigns = await fetchAllPages(
(page, limit) => sdk.campaigns.getCampaigns({ page, limit }),
50, // items per page
100 // max 100 pages (5000 items)
);shared/utils/pagination-utils.ts:185
▸ getMetadataFromTokenUnitResponse(tokenUnit, incrementalId?): TokenMetadataDTO | null
Get metadata from a token unit response Handles metadata-based tokens (ERC-1155 with metadata array)
For metadata-based tokens:
- Returns the metadata object from token.metadata array
- Uses provided incrementalId or tokenMetadataIncrementalId from tokenUnit
- Defaults to index 0 if no incrementalId specified
For standard tokens (no metadata):
- Returns null
| Name | Type | Description |
|---|---|---|
tokenUnit | TokenUnitDTO | The token unit from campaign or balance |
incrementalId? | number | Optional metadata index to use (overrides tokenUnit.tokenMetadataIncrementalId) |
TokenMetadataDTO | null
Token metadata object or null
Example
// Get metadata using tokenUnit's incrementalId
const tokenUnit = {
tokenMetadataIncrementalId: 3,
token: {
metadata: [
{ name: 'Bronze Pass', imageUrl: '...' },
{ name: 'Silver Pass', imageUrl: '...' },
{ name: 'Gold Pass', imageUrl: '...' }
]
}
};
const metadata = getMetadataFromTokenUnitResponse(tokenUnit);
// Returns: { name: 'Bronze Pass', imageUrl: '...' } (index 0 - default)
// Override incrementalId
const metadata2 = getMetadataFromTokenUnitResponse(tokenUnit, 2);
// Returns: { name: 'Gold Pass', imageUrl: '...' } (index 2)
// Standard token (no metadata)
const tokenUnit2 = {
token: { symbol: 'VQP', name: 'Visit Qatar Points' }
};
const metadata3 = getMetadataFromTokenUnitResponse(tokenUnit2);
// Returns: null
// Display name with fallback
const displayName = metadata?.name || tokenUnit.token?.symbol || 'Reward';
// Display image
const imageUrl = metadata?.imageUrl;▸ needsExternalSigning(response): boolean
🔍 Check if a transaction response requires external wallet signing
Returns true when the user needs to sign the transaction externally (e.g., via WebAuthn signer app) before it can be submitted.
| Name | Type |
|---|---|
response | undefined | null | TransactionRequestResponseDTO |
boolean
Example
const response = await sdk.transactions.createTransaction(request);
if (needsExternalSigning(response)) {
const signingUrl = getSigningUrl(response);
// Show "Click to Sign" button with signingUrl
}transaction/models/transaction-request.builder.ts:23
▸ needsSubmission(response): boolean
🔍 Check if a transaction response is signed and ready for submission
Returns true when the user has signed the transaction and it's waiting to be submitted to the blockchain (typically by a business in POS flows).
| Name | Type |
|---|---|
response | undefined | null | TransactionRequestResponseDTO |
boolean
Example
const response = await sdk.transactions.getTransaction(transactionId);
if (needsSubmission(response)) {
// Transaction is signed, ready to submit
await sdk.transactions.submitSignedTransaction({ ... });
}transaction/models/transaction-request.builder.ts:44
▸ getSigningUrl(response, options?): string | null
🔗 Get the signing URL from a transaction response
Returns the URL where the user should be redirected to sign the transaction. Optionally appends signOnly=true for POS flows where the signer app should skip the confirmation UI.
| Name | Type | Description |
|---|---|---|
response | undefined | null | TransactionRequestResponseDTO | Transaction response from API |
options? | Object | Optional configuration |
options.signOnly? | boolean | If true, appends signOnly param for POS flows (default: false) |
string | null
Signing URL or null if not available
Example
const signingUrl = getSigningUrl(response, { signOnly: isPOSTransaction });
if (signingUrl) {
window.open(signingUrl, '_blank');
}transaction/models/transaction-request.builder.ts:70
▸ extractDeadlineFromSigningData(signingData): number | null
Helper to extract deadline from transaction signing data Works with EIP-712 typed data structure from counterfactual wallet
| Name | Type | Description |
|---|---|---|
signingData | unknown | The signing data from TransactionSigningResult |
number | null
Deadline timestamp in seconds, or null if not found
transaction/models/transaction-request.builder.ts:126
▸ buildPendingTransactionData(transactionId, signature, transactionFormat?): PendingTransactionParams & { txType: typeof PENDING_SUBMISSION }
Build pending transaction data for transfer to business Returns properly typed object ready for serialization (QR code, NFC, deep link, etc.)
Pattern from loyalty app: scan.component.ts
| Name | Type | Default value | Description |
|---|---|---|---|
transactionId | string | undefined | Transaction ID from signing result |
signature | string | undefined | User's signature from WebAuthn |
transactionFormat | string | 'EIP-712' | Format (e.g., 'EIP-712') |
PendingTransactionParams & { txType: typeof PENDING_SUBMISSION }
Typed object with txType set to PENDING_SUBMISSION
transaction/models/transaction-request.builder.ts:155
▸ buildMintRequest(data): TransactionRequestDTO
🎯 Build a MINT transaction request (admin/business endpoint) Creates tokens and assigns them to a recipient account
| Name | Type | Description |
|---|---|---|
data | Object | - |
data.amount | number | - |
data.contractAddress | string | - |
data.contractTokenId? | string | - |
data.chainId | number | - |
data.recipientAccountId? | string | - |
data.recipientAccountType | AccountOwnerType | - |
data.recipientAccountAddress? | string | - |
data.engagedBusinessId? | string | Business commercially involved in this transaction (for stats/reporting) |
data.context? | DynamicContext | Dynamic context for ERC721 template interpolation and AI prompts. Values become available as {{context.keyName}} placeholders. Special keys: validityDate, validityEndDate, validityDuration |
TransactionRequestDTO
Example
const request = buildMintRequest({
amount: 100,
contractAddress: '0x...',
chainId: 137,
recipientAccountId: 'user-123',
recipientAccountType: AccountOwnerType.USER,
engagedBusinessId: 'business-456' // optional: for tracking which business triggered the mint
});Example
const request = buildMintRequest({
amount: 1,
contractAddress: '0x...',
contractTokenId: '123', // TokenMetadata ID
chainId: 137,
recipientAccountId: 'user-123',
recipientAccountType: AccountOwnerType.USER,
context: {
// Validity control
validityDate: '2026-04-15T14:00:00Z',
validityEndDate: '2026-04-20T11:00:00Z',
// AI prompt placeholders (available as {{context.xxx}})
guestName: 'John Doe',
roomNumber: '305',
awardReason: 'Employee of the Month'
}
});transaction/models/transaction-request.builder.ts:282
▸ buildBurnRequest(data): TransactionRequestDTO
🎯 Build a BURN transaction request For auth endpoint: sender is handled automatically by backend For admin endpoint: provide senderAccountId/Type to burn on behalf of user
| Name | Type |
|---|---|
data | { amount: number ; contractAddress: string ; contractTokenId?: string ; chainId: number ; senderAccountId?: string ; senderAccountType?: AccountOwnerType ; senderAccountAddress?: string } & POSAuthorizationOptions |
TransactionRequestDTO
Example
// Auth endpoint (sender auto-resolved)
const request = buildBurnRequest({
amount: 50,
contractAddress: '0x...',
chainId: 137
});
// Admin endpoint (explicit sender)
const request = buildBurnRequest({
amount: 50,
contractAddress: '0x...',
chainId: 137,
senderAccountId: 'user-123',
senderAccountType: AccountOwnerType.USER
});
// POS burn (business submits on behalf of user)
const request = buildBurnRequest({
amount: 50,
contractAddress: '0x...',
chainId: 137,
engagedBusinessId: 'business-456',
authorizedSubmitterId: 'business-456',
authorizedSubmitterType: AccountOwnerType.BUSINESS
});transaction/models/transaction-request.builder.ts:349
▸ buildTransferRequest(data): TransactionRequestDTO
🎯 Build a TRANSFER transaction request (business endpoint) Transfers tokens between accounts
| Name | Type |
|---|---|
data | { amount: number ; contractAddress: string ; contractTokenId?: string ; chainId: number ; senderAccountId?: string ; senderAccountType: AccountOwnerType ; senderAccountAddress?: string ; recipientAccountId?: string ; recipientAccountType: AccountOwnerType ; recipientAccountAddress?: string } & POSAuthorizationOptions |
TransactionRequestDTO
Example
const request = buildTransferRequest({
amount: 25,
contractAddress: '0x...',
chainId: 137,
senderAccountId: 'user-123',
senderAccountType: AccountOwnerType.USER,
recipientAccountId: 'business-456',
recipientAccountType: AccountOwnerType.BUSINESS
});Example
const request = buildTransferRequest({
amount: 25,
contractAddress: '0x...',
chainId: 137,
senderAccountId: 'user-123',
senderAccountType: AccountOwnerType.USER,
recipientAccountId: 'business-456',
recipientAccountType: AccountOwnerType.BUSINESS,
// POS authorization - allows business to submit the signed transaction
engagedBusinessId: 'business-456',
authorizedSubmitterId: 'business-456',
authorizedSubmitterType: AccountOwnerType.BUSINESS
});transaction/models/transaction-request.builder.ts:411
▸ buildSubmissionRequest(params): TransactionSubmissionRequestDTO
🎯 Build a transaction submission request from QR code parameters Handles the logic of mapping signature to the correct field based on transaction format.
| Name | Type |
|---|---|
params | Object |
params.transactionId | string |
params.transactionFormat | string |
params.signature | string |
TransactionSubmissionRequestDTO
Example
const request = buildSubmissionRequest({
transactionId: 'tx-123',
transactionFormat: 'EIP-712',
signature: '0x...'
});transaction/models/transaction-request.builder.ts:461
▸ buildPOSTransferRequest(data): TransactionRequestDTO
🎯 Build a POS TRANSFER transaction request Convenience function for POS (Point of Sale) scenarios where a business submits a transaction on behalf of a user.
This sets up the authorization fields correctly so the business can submit the user-signed transaction.
| Name | Type | Description |
|---|---|---|
data | Object | - |
data.amount | number | - |
data.contractAddress | string | - |
data.contractTokenId? | string | - |
data.chainId | number | - |
data.userId | string | The user sending tokens |
data.userAccountAddress? | string | - |
data.businessId | string | The business receiving tokens and authorized to submit |
data.businessAccountAddress? | string | - |
TransactionRequestDTO
Example
// Step 1: Create POS transaction (user to business)
const request = buildPOSTransferRequest({
amount: 100,
contractAddress: '0x...',
chainId: 137,
userId: 'user-123',
businessId: 'business-456'
});
// Step 2: Prepare and get signing data
const response = await sdk.transactions.prepareClientSignedTransaction(request);
// Step 3: User signs the transaction
const signature = await userWallet.signTypedData(response.signingData);
// Step 4: Business submits the signed transaction
await sdk.transactions.submitSignedTransaction({
transactionId: response.transaction.id,
type: 'EIP_712',
signature
});transaction/models/transaction-request.builder.ts:507
▸ buildPOSBurnRequest(data): TransactionRequestDTO
🎯 Build a POS BURN transaction request Convenience function for POS scenarios where a business facilitates a user burning tokens (e.g., redeeming rewards at point of sale).
This sets up the authorization fields correctly so the business can submit the user-signed burn transaction.
| Name | Type | Description |
|---|---|---|
data | Object | - |
data.amount | number | - |
data.contractAddress | string | - |
data.contractTokenId? | string | - |
data.chainId | number | - |
data.userId | string | The user burning tokens |
data.userAccountAddress? | string | - |
data.businessId | string | The business facilitating the burn and authorized to submit |
TransactionRequestDTO
Example
// Step 1: Create POS burn transaction
const request = buildPOSBurnRequest({
amount: 1,
contractAddress: '0x...',
contractTokenId: '123', // NFT token ID
chainId: 137,
userId: 'user-123',
businessId: 'business-456'
});
// Step 2: Prepare and get signing data
const response = await sdk.transactions.prepareClientSignedTransaction(request);
// Step 3: User signs the transaction
const signature = await userWallet.signTypedData(response.signingData);
// Step 4: Business submits the signed transaction
await sdk.transactions.submitSignedTransaction({
transactionId: response.transaction.id,
type: 'EIP_712',
signature
});transaction/models/transaction-request.builder.ts:571
▸ createUserStatusSDK(apiClient): Object
Create a complete User Status SDK instance
| Name | Type | Description |
|---|---|---|
apiClient | PersApiClient | Configured PERS API client |
Object
User Status SDK with flattened structure for better DX
| Name | Type |
|---|---|
getRemoteUserStatusTypes | (options?: PaginationOptions) => Promise<PaginatedResponseDTO<UserStatusTypeDTO>> |
getRemoteEarnedUserStatus | (options?: PaginationOptions) => Promise<PaginatedResponseDTO<UserStatusTypeDTO>> |
createUserStatusType | (userStatusType: UserStatusTypeDTO) => Promise<UserStatusTypeDTO> |
updateUserStatusType | (id: number, userStatusType: UserStatusTypeDTO) => Promise<UserStatusTypeDTO> |
deleteUserStatusType | (id: number) => Promise<void> |
api | UserStatusApi |
service | UserStatusService |
Renames and re-exports ClientTransactionType
Ƭ CampaignClaimFilters: CampaignClaimQueryParams
Deprecated
Use CampaignClaimQueryParams instead. Will be removed in next major version.
Ƭ CampaignClaimQueryOptions: CampaignClaimQueryParams
Deprecated
Use CampaignClaimQueryParams instead. Will be removed in next major version.
Ƭ CampaignFilterOptionsWithInclude: CampaignQueryParams
Deprecated
Use CampaignQueryParams instead. Will be removed in next major version.
campaign/services/campaign-service.ts:27
Ƭ CampaignFilterOptions: CampaignQueryParams
Deprecated
Use CampaignQueryParams instead. Will be removed in next major version.
campaign/services/campaign-service.ts:32
Ƭ SdkErrorCode: typeof SdkErrorCodes[keyof typeof SdkErrorCodes]
Ƭ NotificationLevel: "success" | "error"
Notification level - UI display hint
Ƭ EventDetails: Record<string, unknown>
Event details - untyped bag for logging/debugging
Ƭ AuthEventType: "login_success" | "logout_success" | "session_restored" | "session_restoration_failed" | "token_refreshed" | "auth_failed"
Auth domain event types
NOTE: Uses lowercase to match backend event format
Ƭ TransactionEventType: "transaction_created" | "transaction_submitted" | "transaction_signed" | "transaction_confirmed"
Transaction domain event types
Ƭ CampaignEventType: "claim_success" | "campaign_trigger_created" | "campaign_trigger_updated" | "campaign_trigger_deleted" | "campaign_trigger_assigned" | "campaign_trigger_removed" | "trigger_source_assigned" | "campaign_expired"
Campaign domain event types
Ƭ RedemptionEventType: "redeem_success" | "redemption_created" | "redemption_expired"
Redemption domain event types
Ƭ NotificationEventType: "notification_pending" | "notification_sent"
Notification domain event types
core/events/event-types.ts:124
Ƭ KnownEventType: AuthEventType | TransactionEventType | CampaignEventType | RedemptionEventType | BusinessEventType | UserEventType | TriggerSourceEventType | WebhookEventType | CustomFieldEventType | NotificationEventType | WalletEventType | ApiErrorType
All known event types
core/events/event-types.ts:141
Ƭ PersEvent: SuccessEvent | ErrorEvent
Universal event type - discriminated union based on level
Success events can only use business domains (Domain). Error events can use all domains including technical (ErrorDomain).
core/events/event-types.ts:213
Ƭ EventHandler: (event: PersEvent) => void | Promise<void>
Event handler callback (can be sync or async)
▸ (event): void | Promise<void>
| Name | Type |
|---|---|
event | PersEvent |
void | Promise<void>
core/events/event-types.ts:222
Ƭ Unsubscribe: () => void
Unsubscribe function
▸ (): void
void
core/events/event-types.ts:227
Ƭ AnyDomain: Domain | ErrorDomain
All domain types (business + error domains)
core/events/event-types.ts:230
Ƭ SuccessEventInput: Omit<SuccessEvent, "id" | "timestamp" | "level">
Success event input (without auto-generated fields and level) Level is automatically set to 'success' by emitSuccess()
core/events/event-types.ts:281
Ƭ ErrorEventInput: Omit<ErrorEvent, "id" | "timestamp" | "level">
Error event input (without auto-generated fields and level) Level is automatically set to 'error' by emitError()
core/events/event-types.ts:287
Ƭ PersEnvironment: "staging" | "production"
PERS API environment targets
Ƭ PersApiVersion: "v2"
Supported PERS API versions
Ƭ NotificationPendingHandler: (info: NotificationPendingInfo) => void
Handler for real-time notification wake signals (notification.pending).
▸ (info): void
| Name | Type |
|---|---|
info | NotificationPendingInfo |
void
events/pers-events-client.ts:61
Ƭ RedemptionRedeemFilters: RedemptionRedeemQueryParams
Deprecated
Use RedemptionRedeemQueryParams instead. Will be removed in next major version.
Ƭ RedemptionRedeemQueryOptions: RedemptionRedeemQueryParams
Deprecated
Use RedemptionRedeemQueryParams instead. Will be removed in next major version.
Ƭ RedemptionFilterOptionsWithInclude: RedemptionQueryParams
Deprecated
Use RedemptionQueryParams instead. Will be removed in next major version.
redemption/services/redemption-service.ts:23
Ƭ ListResponse<T>: T[] | PaginatedResponseDTO<T>
Type alias for hybrid period (backend can return either shape) Use this in API method return types during backend hybrid phase
Example
// During hybrid backend phase
async getItems(): Promise<ListResponse<ItemDTO>> {
return this.apiClient.get<ListResponse<ItemDTO>>('/items');
}| Name |
|---|
T |
shared/utils/pagination-utils.ts:53
Ƭ TokenMetadataQueryOptions: TokenMetadataQueryParams
Deprecated
Use TokenMetadataQueryParams instead. Will be removed in next major version.
Ƭ RewardsFilterOptions: Omit<TokenMetadataQueryParams, "tokenType">
Filter options for rewards (ERC1155 token metadata) Omits tokenType since it's always ERC1155
Ƭ StampsFilterOptions: Omit<TokenMetadataQueryParams, "tokenType">
Filter options for stamps (ERC721 token metadata) Omits tokenType since it's always ERC721
Ƭ TransactionQueryOptions: TransactionQueryParams
Deprecated
Use TransactionQueryParams instead. Will be removed in next major version.
transaction/models/index.ts:20
Ƭ ClientTransactionType: typeof ClientTransactionType[keyof typeof ClientTransactionType]
transaction/models/transaction-request.builder.ts:96
transaction/models/transaction-request.builder.ts:102
Ƭ UserStatusSDK: ReturnType<typeof createUserStatusSDK>
Ƭ UserQueryOptions: UserQueryParams
Deprecated
Use UserQueryParams instead. Will be removed in next major version.
• Const DPOP_STORAGE_KEYS: Object
| Name | Type |
|---|---|
PUBLIC | "pers_dpop_public_key" |
PRIVATE | "pers_dpop_private_key" |
core/auth/dpop/dpop-manager.ts:5
• Const FATAL_AUTH_CODES: readonly ["REFRESH_TOKEN_EXPIRED", "REFRESH_TOKEN_REVOKED", "INVALID_TOKEN", "TOKEN_REVOKED"]
Fatal auth error codes that require immediate logout. These indicate the session is completely invalid and cannot be recovered. TOKEN_EXPIRED is NOT in this list - it's the normal "please refresh" case.
Values validated against CommonErrorCodes from @explorins/pers-shared at compile time.
SINGLE SOURCE OF TRUTH - use this constant everywhere, never duplicate these values.
core/auth/services/auth-service.ts:42
• Const AUTH_STORAGE_KEYS: Object
| Name | Type |
|---|---|
ACCESS_TOKEN | "pers_access_token" |
REFRESH_TOKEN | "pers_refresh_token" |
PROVIDER_TOKEN | "pers_provider_token" |
AUTH_TYPE | "pers_auth_type" |
• Const globalCacheService: CacheService
core/cache/cache.service.ts:324
• Const CacheTTL: Object
| Name | Type |
|---|---|
SHORT | number |
MEDIUM | number |
LONG | number |
METADATA | number |
GATEWAY | number |
PROVIDER | number |
• Const environment: EnvironmentInfo
Global environment info (cached)
• Const SdkErrorCodes: Object
SDK-internal error codes for auth flow control These are not backend errors - they're used for SDK-internal state management
| Name | Type |
|---|---|
TOKEN_REFRESH_NEEDED | "TOKEN_REFRESH_NEEDED" |
PROVIDER_TOKEN_REFRESH_NEEDED | "PROVIDER_TOKEN_REFRESH_NEEDED" |
LOGOUT_REQUIRED | "LOGOUT_REQUIRED" |
NETWORK_ERROR | "NETWORK_ERROR" |
API_ERROR | "API_ERROR" |
• Const ApiErrorDetector: Object
| Name | Type |
|---|---|
getErrorMessage | (error: unknown) => string |
getStatusCode | (error: unknown) => null | number |
isRetryable | (error: unknown) => boolean |
isAuthError | (error: unknown) => boolean |
• Const DEFAULT_PERS_CONFIG: Object
Default configuration values
| Name | Type |
|---|---|
environment | "production" |
apiVersion | "v2" |
timeout | 30000 |
retries | 3 |
tokenRefreshMargin | 60 |
backgroundRefreshThreshold | 30 |
captureWalletEvents | true |
autoRestoreSession | true |
• Const SDK_NAME: string = __SDK_NAME__
SDK package name
• Const SDK_VERSION: string = __SDK_VERSION__
SDK version - injected from package.json at build time
• Const SDK_USER_AGENT: string
Full SDK identifier for headers
• Const ClientTransactionType: Object
Client-side transaction types extending backend Web3TransactionType Includes client-specific flows like pending submissions (POS flow)
Pattern follows loyalty app: extend Web3TransactionType with client-side types
| Name | Type | Description |
|---|---|---|
PENDING_SUBMISSION | "PENDING_SUBMISSION" | Transaction signed by user, pending business submission (POS QR flow) |