UNPKG

@nhost/react

Version:

Nhost React library

34 lines (33 loc) 1 kB
import { ActionErrorState, ActionSuccessState, LinkIdTokenHandlerParams, LinkIdTokenHandlerResult } from '@nhost/nhost-js'; interface LinkIdTokenHandler { (params: LinkIdTokenHandlerParams): Promise<LinkIdTokenHandlerResult>; } export interface LinkIdTokenHookResult extends ActionErrorState, ActionSuccessState { linkIdToken: LinkIdTokenHandler; } interface LinkIdTokenHook { (): LinkIdTokenHookResult; } /** * Use the hook `useLinkIdToken` to link a user account with the provider's account using an id token * * @example * ```tsx * const { linkIdToken, isLoading, isSuccess, isError, error } = useLinkIdToken() * * const handleFormSubmit = async (e) => { * e.preventDefault(); * * await linkIdToken({ * provider: 'google', * idToken: '...', * nonce: '...' * }) * } * ``` * * @docs https://docs.nhost.io/reference/react/use-link-id-token */ export declare const useLinkIdToken: LinkIdTokenHook; export {}; //# sourceMappingURL=useLinkIdToken.d.ts.map