methods/discord/react
For AI agents: see llms.txt for the complete documentation index. Markdown versions are available by adding .md to a page URL or requesting Accept: text/markdown.
React client for the Discord sign-in method, exported at
@convex-dev/auth/methods/discord/react.
useSignInWithDiscord 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 } = useSignInWithDiscord(api.auth);
const { flowError } = useOauth();
Type Aliases
UseSignInWithDiscordReturn
type UseSignInWithDiscordReturn = object;
What useSignInWithDiscord returns.
Properties
| Property | Type | Description |
|---|---|---|
signIn | UseOauthSignInReturn["signIn"] | Start Discord's OAuth flow. See UseOauthSignInReturn.signIn. |
Functions
useSignInWithDiscord()
function useSignInWithDiscord(api): UseSignInWithDiscordReturn;
Sign in with Discord. 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
| Parameter | Type |
|---|---|
api | { completeSignInWithDiscord: 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"; }; }>>; startSignInWithDiscord: FunctionReference<"mutation", "public", { redirectTo: string; }, { redirect: string; state: string; }>; } |
api.completeSignInWithDiscord | 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"; }; }>> |
api.startSignInWithDiscord | FunctionReference<"mutation", "public", { redirectTo: string; }, { redirect: string; state: string; }> |
Returns
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