Theia API Documentation v1.77.0
    Preparing search index...

    Service handling the OAuth 2.0 authorization code flow (with PKCE) used to access OpenAI models with a ChatGPT subscription instead of an API key.

    interface ChatGptAuthService {
        onAuthStateChanged: Event<ChatGptAuthState>;
        cancelLogin(): Promise<void>;
        completeLogin(codeOrRedirectUrl: string): Promise<boolean>;
        getAuthState(): Promise<ChatGptAuthState>;
        signOut(): Promise<void>;
        startLogin(): Promise<ChatGptLoginSession>;
        waitForLogin(): Promise<boolean>;
    }

    Hierarchy (View Summary)

    Index
    onAuthStateChanged: Event<ChatGptAuthState>

    Emitted whenever the sign in state changes.

    • Completes the pending login with a manually provided authorization code or the full redirect URL.

      Parameters

      • codeOrRedirectUrl: string

      Returns Promise<boolean>

      true if the sign in completed

    • Waits for the browser to deliver the authorization code to the local callback listener.

      Returns Promise<boolean>

      true if the sign in completed, false if it was cancelled or timed out