Skip to main content

methods/github/react

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

useSignInWithGithub 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 } = useSignInWithGithub(api.auth);
const { flowError } = useOauth();

Type Aliases​

UseSignInWithGithubReturn​

type UseSignInWithGithubReturn = object;

What useSignInWithGithub returns.

Properties​

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

Functions​

useSignInWithGithub()​

function useSignInWithGithub(api): UseSignInWithGithubReturn;

Sign in with GitHub. 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{ completeSignInWithGithub: 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"; }; }>>; startSignInWithGithub: FunctionReference<"mutation", "public", { redirectTo: string; }, { redirect: string; state: string; }>; }
api.completeSignInWithGithubFunctionReference<"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.startSignInWithGithubFunctionReference<"mutation", "public", { redirectTo: string; }, { redirect: string; state: string; }>

Returns​

UseSignInWithGithubReturn

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