@refoldai/refold-js
    Preparing search index...

    Interface ConnectParams

    Which credentials a connect uses, and what to store against the connection.

    interface ConnectParams {
        authProfileId?: string;
        autoClose?: boolean;
        connectionId?: string;
        grantType?: GrantType;
        payload?: Record<string, string>;
        preRequisiteFields?: Record<string, unknown>;
        signal?: AbortSignal;
        slug: string;
        timeout?: number;
        type?: AuthType | ConnectorAuthType;
        userDefinedFields?: Record<string, unknown>;
    }

    Hierarchy (View Summary)

    Index
    authProfileId?: string

    The credential set to connect with, from an application's auth profiles. Omitted, the application's default profile is used.

    autoClose?: boolean

    Whether to close the authentication window automatically once the connection succeeds or the wait times out.

    connectionId?: string

    An existing connection to re-authenticate instead of opening a new one.

    grantType?: GrantType

    The application's OAuth grant (from the app object). It no longer selects the transport — every connect is a POST and the server decides — but it still routes: Refold.connect sends a payload-bearing connect down the OAuth path rather than the key-based one when this names GrantType.ClientCredentials and no type was given. Pass type explicitly and it is not needed.

    payload?: Record<string, string>

    The key value pairs of auth data.

    preRequisiteFields?: Record<string, unknown>

    Values the application requires before it can be connected. Read by applications on auth profiles and by connectors; other native applications take theirs as flat keys in payload.

    signal?: AbortSignal

    Signal used to give up on an in-progress authentication — abort it and the returned promise resolves false. Providers that sever the authentication window's handle make an abandoned flow undetectable, so this is the only way to end such a wait before the timeout.

    slug: string

    The application slug.

    timeout?: number

    Maximum time in milliseconds to wait for authentication before giving up. Set to 0 to wait indefinitely. Defaults to 3 minutes.

    The authentication type to use — an AuthType for native applications, or one of a universal connector's own types (a key of Application.auth_type_options). If not provided, it defaults to keybased when a payload is given, otherwise oauth2.

    userDefinedFields?: Record<string, unknown>

    Caller metadata to store against the connection.