Skip to content

@egain/ai-agent-sdk API Reference - v0.1.1 / AuthStrategy

Interface: AuthStrategy

Base interface for authentication strategies All authentication strategies must implement this interface

Hierarchy

Implemented by

Table of contents

Methods

Methods

getToken

getToken(): Promise<null | string>

Get an authentication token This method may be called multiple times, so implementations should handle token refresh if needed

Returns

Promise<null | string>

Inherited from

AuthProvider.getToken

Defined in

core/auth/AuthProvider.ts:11


initialize

initialize(options?): Promise<void>

Initialize the authentication strategy This method sets up the strategy but does not perform authentication Called when the strategy is set on the agent

Parameters

NameTypeDescription
options?AuthStrategyInitializeOptionsInitialize options including postAuthentication callback

Returns

Promise<void>

Defined in

core/auth/AuthStrategy.ts:65


authenticate

authenticate(): Promise<void>

Authenticate the user This method performs the actual authentication flow The postAuthentication callback registered during initialize() will be called after authentication completes

Returns

Promise<void>

Defined in

core/auth/AuthStrategy.ts:72


cleanup

cleanup(): Promise<void>

Cleanup resources when the strategy is no longer needed

Returns

Promise<void>

Defined in

core/auth/AuthStrategy.ts:77


getDomain

getDomain(): string

Get the domain for authentication

Returns

string

Defined in

core/auth/AuthStrategy.ts:82

Released under the MIT License.