ping-identity
    Preparing search index...

    Type Alias DaVinciClient

    DaVinci imperative client API contract.

    Obtain an instance via createDaVinciClient.

    const client = createDaVinciClient({ modules: { oidc: { ... } } });

    const firstNode = await client.start();
    // ... collect user input ...
    const nextNode = await client.next({ collectors: [{ key: 'username', value: 'alice' }] });

    if (nextNode.type === 'SuccessNode') {
    const session = await client.user();
    console.log('Access token:', session?.accessToken);
    }
    type DaVinciClient = {
        dispose: () => Promise<void>;
        logoutUser: () => Promise<void>;
        next: (input: DaVinciNextInput) => Promise<DaVinciNode>;
        refresh: () => Promise<DaVinciUserSession | null>;
        revoke: () => Promise<boolean>;
        start: () => Promise<DaVinciNode>;
        user: () => Promise<DaVinciUserSession | null>;
        userinfo: () => Promise<Record<string, unknown> | null>;
    }
    Index

    Properties

    dispose: () => Promise<void>

    Dispose the native DaVinci instance and release runtime state.

    Type Declaration

      • (): Promise<void>
      • Returns Promise<void>

        Promise resolved when disposal completes.

    When disposal fails.

    logoutUser: () => Promise<void>

    Log out the active user and clear the session.

    Type Declaration

      • (): Promise<void>
      • Returns Promise<void>

        Promise resolved when logout completes.

    When logout fails.

    next: (input: DaVinciNextInput) => Promise<DaVinciNode>

    Advance the active DaVinci flow by applying collector values.

    Type Declaration

    When value application or progression fails.

    refresh: () => Promise<DaVinciUserSession | null>

    Refresh the active user session tokens.

    Type Declaration

    When refresh fails.

    revoke: () => Promise<boolean>

    Revoke the active user access/refresh tokens.

    Type Declaration

      • (): Promise<boolean>
      • Returns Promise<boolean>

        true when revocation completes.

    When revocation fails.

    start: () => Promise<DaVinciNode>

    Start the DaVinci flow.

    Type Declaration

    The flow entry point is determined by the discovery URL in config — no name is passed at runtime (unlike Journey). Each call starts a fresh flow.

    When start fails.

    user: () => Promise<DaVinciUserSession | null>

    Resolve the active user session.

    Type Declaration

    When session retrieval fails.

    userinfo: () => Promise<Record<string, unknown> | null>

    Resolve userinfo claims for the active session.

    Type Declaration

      • (): Promise<Record<string, unknown> | null>
      • Returns Promise<Record<string, unknown> | null>

        Userinfo payload, or null when no active session exists.

    When userinfo retrieval fails.