Skip to main content

methods/apple/react

React client for the Apple sign-in method, exported at @convex-dev/auth/methods/apple/react.

useSignInWithApple starts the sign-in. useOauth returns the state that is shared by all the OAuth methods, for example the error of the last flow.

const { signIn } = useSignInWithApple(api.auth);
const { flowError } = useOauth();

Type Aliases​

UseSignInWithAppleReturn​

type UseSignInWithAppleReturn = object;

What useSignInWithApple returns.

Properties​

PropertyTypeDescription
signInUseOauthSignInReturn["signIn"]Start Apple's OAuth flow. See UseOauthSignInReturn.signIn.

Functions​

useSignInWithApple()​

function useSignInWithApple(api): UseSignInWithAppleReturn;

Sign in with Apple. Pass the module exporting the functions of the method (usually the generated api.auth), or an object mapping the canonical keys to renamed exports.

Parameters​

ParameterType
api{ completeSignInWithApple: FunctionReference<"mutation", "public", { code: string; state: string; }, ClientView< | { status: "complete"; tokens: { accessToken: string; refreshToken: string; refreshTokenExpiresAt: number; userId: string; }; } | { status: "error"; userError: { error: "INVALID_CODE"; }; }>>; startSignInWithApple: FunctionReference<"mutation", "public", { redirectTo: string; }, { redirect: string; state: string; }>; }
api.completeSignInWithAppleFunctionReference<"mutation", "public", { code: string; state: string; }, ClientView< | { status: "complete"; tokens: { accessToken: string; refreshToken: string; refreshTokenExpiresAt: number; userId: string; }; } | { status: "error"; userError: { error: "INVALID_CODE"; }; }>>
api.startSignInWithAppleFunctionReference<"mutation", "public", { redirectTo: string; }, { redirect: string; state: string; }>

Returns​

UseSignInWithAppleReturn

References​

OauthCompleteResult​

Re-exports OauthCompleteResult


OauthFlowError​

Re-exports OauthFlowError


OauthStartResult​

Re-exports OauthStartResult


SignInOptions​

Re-exports SignInOptions


useOauth​

Re-exports useOauth


UseOauthReturn​

Re-exports UseOauthReturn