Amplify JS API Documentation
    Preparing search index...

    Interface AmplifyContext

    The context object returned by createAmplifyContext(). Pass this as the first argument to every Amplify category API to provide configuration and auth credentials without relying on global singleton state.

    interface AmplifyContext {
        libraryOptions: Readonly<LibraryOptions>;
        resourcesConfig: Readonly<ResourcesConfig>;
        token: AmplifyContextToken;
        clearCredentials(): Promise<void>;
        fetchAuthSession(options?: FetchAuthSessionOptions): Promise<AuthSession>;
        getTokens(
            options: FetchAuthSessionOptions,
        ): Promise<AuthTokens | undefined>;
    }
    Index

    Properties

    libraryOptions: Readonly<LibraryOptions>
    resourcesConfig: Readonly<ResourcesConfig>
    token: AmplifyContextToken

    Per-context identity handle; see AmplifyContextToken. All legitimate producers are the Amplify context factories, which attach a fresh, frozen token per context.

    Methods

    • Returns Promise<void>