@egain/ai-agent-sdk API Reference - v0.1.1 / AnonymousAuthStrategy
Class: AnonymousAuthStrategy
Anonymous authentication strategy No authentication required - user remains anonymous
Implements
Table of contents
Constructors
Properties
Methods
- initialize
- clearMetadataCache
- authenticate
- isAuthenticated
- getToken
- clearTokenCache
- cleanup
- getDeploymentInfo
Constructors
constructor
• new AnonymousAuthStrategy(config?): AnonymousAuthStrategy
Parameters
| Name | Type |
|---|---|
config? | AnonymousAuthConfig |
Returns
Defined in
core/auth/AnonymousAuthStrategy.ts:94
Properties
TOKEN_EXPIRY_BUFFER_MS
▪ Static Readonly TOKEN_EXPIRY_BUFFER_MS: number
Buffer time in milliseconds to refresh token before it expires This prevents using a token that's about to expire
Defined in
core/auth/AnonymousAuthStrategy.ts:92
Methods
initialize
▸ initialize(options?): Promise<void>
Initialize the anonymous authentication strategy
Parameters
| Name | Type |
|---|---|
options? | AuthStrategyInitializeOptions |
Returns
Promise<void>
Implementation of
Defined in
core/auth/AnonymousAuthStrategy.ts:114
clearMetadataCache
▸ clearMetadataCache(): void
Clears all cached metadata entries
Returns
void
Defined in
core/auth/AnonymousAuthStrategy.ts:166
authenticate
▸ authenticate(): Promise<void>
Authenticate the anonymous user
Returns
Promise<void>
Implementation of
Defined in
core/auth/AnonymousAuthStrategy.ts:203
isAuthenticated
▸ isAuthenticated(): boolean
Check if the user is currently authenticated
Returns
boolean
Defined in
core/auth/AnonymousAuthStrategy.ts:216
getToken
▸ getToken(): Promise<null | string>
Get authentication token for anonymous user Returns cached token if valid, otherwise fetches a new one Token is cached with TTL based on expires_in from the token response
Returns
Promise<null | string>
Implementation of
Defined in
core/auth/AnonymousAuthStrategy.ts:267
clearTokenCache
▸ clearTokenCache(): void
Clear the cached token Forces a new token to be fetched on next getToken() call
Returns
void
Defined in
core/auth/AnonymousAuthStrategy.ts:338
cleanup
▸ cleanup(): Promise<void>
Cleanup resources
Returns
Promise<void>
Implementation of
Defined in
core/auth/AnonymousAuthStrategy.ts:347
getDeploymentInfo
▸ getDeploymentInfo(domain): Promise<any>
Get deployment information a given domain
Parameters
| Name | Type |
|---|---|
domain | string |
Returns
Promise<any>