• useLinkController hook.

    Provides initLinkController and presentLinkController methods with a shared loading state. Call initLinkController once when your checkout screen loads, then presentLinkController when the customer taps your Link button.

    Returns {
        loading: boolean;
        initLinkController: (
            params: LinkController.Configuration,
        ) => Promise<InitResult>;
        presentLinkController: () => Promise<PresentResult>;
        confirmLinkControllerSetupIntent: (
            clientSecret: string,
        ) => Promise<LinkController.ConfirmSetupIntentResult>;
    }

    • loading: boolean

      Whether an operation is currently in progress.

    • initLinkController: (params: LinkController.Configuration) => Promise<InitResult>

      Initializes the LinkController with the provided configuration. Must be called before presentLinkController.

    • presentLinkController: () => Promise<PresentResult>

      Presents the Link flow. Must be called after initLinkController.

    • confirmLinkControllerSetupIntent: (clientSecret: string) => Promise<LinkController.ConfirmSetupIntentResult>

      Confirms a SetupIntent using the payment method from the most recent presentLinkController call. Must be called after a successful presentation.

    This API is in private preview and may change without notice.