PERS SDK - v2.3.26 / Exports / TenantApi
Platform-Agnostic Tenant API Client
Handles tenant and admin operations using the PERS backend. Updated to match new RESTful tenant controller endpoints.
Note: Special header handling (bypass-auth-interceptor) should be handled by PersApiClient internally or through endpoint-specific configuration.
- getRemoteTenant
- getRemoteTenantPublic
- getRemoteLoginToken
- getRemoteClientConfig
- getPublicTenantById
- getCurrentAdmin
- updateRemoteTenant
- getAdmins
- postAdmin
- putAdmin
• new TenantApi(apiClient): TenantApi
| Name | Type |
|---|---|
apiClient | PersApiClient |
▸ getRemoteTenant(): Promise<TenantDTO>
API KEY + ADMIN JWT: Get full tenant information including sensitive config Uses /tenants/me endpoint with Admin JWT authentication
Requires: X-API-Key header + Authorization Bearer token (Admin JWT) Returns: Full tenant information including allowedTokenIssuers and sensitive config
Promise<TenantDTO>
▸ getRemoteTenantPublic(): Promise<TenantPublicDTO>
API KEY: Get current tenant public information Uses /tenants/me endpoint with API key authentication
Requires: X-API-Key header (handled by PersApiClient) Returns: Public tenant information (no sensitive config)
Promise<TenantPublicDTO>
▸ getRemoteLoginToken(): Promise<string>
API KEY: Get remote login token UPDATED: Requires API key authentication
Promise<string>
▸ getRemoteClientConfig(): Promise<TenantClientConfigDTO>
API KEY: Get remote client configuration UPDATED: Requires API key authentication
Promise<TenantClientConfigDTO>
▸ getPublicTenantById(tenantId): Promise<TenantPublicDTO>
PUBLIC: Get tenant public information by ID (no auth required) NEW: For cases where you need public tenant info without API key
| Name | Type | Description |
|---|---|---|
tenantId | string | The tenant ID to retrieve public information for |
Promise<TenantPublicDTO>
▸ getCurrentAdmin(): Promise<AdminDTO>
ADMIN: Get current admin info (tenant admin authentication required)
Endpoint: GET /admins/me Auth: @Admin()
Promise<AdminDTO>
▸ updateRemoteTenant(tenantData): Promise<TenantDTO>
ADMIN: Update tenant information UPDATED: Uses PUT /tenants (admin endpoint) Returns full TenantDTO including sensitive config
| Name | Type |
|---|---|
tenantData | TenantUpdateRequestDTO |
Promise<TenantDTO>
▸ getAdmins(options?): Promise<PaginatedResponseDTO<AdminDTO>>
ADMIN: Get all tenant admins
| Name | Type | Description |
|---|---|---|
options? | PaginationOptions | Pagination options (page, limit, sortBy, sortOrder) |
Promise<PaginatedResponseDTO<AdminDTO>>
Paginated response with tenant admins
▸ postAdmin(adminData): Promise<AdminDTO>
ADMIN: Create new admin
| Name | Type |
|---|---|
adminData | AdminCreateRequestDTO |
Promise<AdminDTO>
▸ putAdmin(adminId, adminData): Promise<AdminDTO>
ADMIN: Update admin (toggle tenant association)
| Name | Type |
|---|---|
adminId | string |
adminData | AdminCreateRequestDTO |
Promise<AdminDTO>