Alchemy Logo

useAddOauthProvider

function useAddOauthProvider(mutationArgs?): UseAddOauthProviderResult;

Defined in: account-kit/react/dist/types/hooks/useAddOauthProvider.d.ts:36

A custom hook to handle adding an OAuth provider to an already authenticated account, which includes executing a mutation with optional parameters.

import { useAddOauthProvider } from "@account-kit/react";
 
const { addOauthProvider, isAddingOauthProvider, error } = useAddOauthProvider({
  // these are optional
  onSuccess: () => {
    // do something on success
  },
  onError: (error) => console.error(error),
});

ParameterTypeDescription

mutationArgs?

Partial<Omit<UseMutationOptions<OauthProviderInfo, Error, Omit<object & OauthProviderConfig & OauthRedirectConfig, "type">, unknown>, "mutationFn" | "mutationKey">>

Optional arguments for the mutation used for adding an OAuth provider.

UseAddOauthProviderResult

An object containing the addOauthProvider function, addOauthProviderAsync for async execution, a boolean isAddingOauthProvider to track the mutation status, and any error encountered.

Was this page helpful?