new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Better Auth · Authentication · all subjects

social sign-on/twitch

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Twitch provider setup requires client ID and secret

To set up Twitch sign-in, obtain a client ID and client secret from the Twitch Developer Portal at https://dev.twitch.tv/console/apps.

Twitch redirect URL for local development

For local development, set the Twitch redirect URL to http://localhost:3000/api/auth/callback/twitch.

Twitch redirect URL must be updated for production

For production, the Twitch redirect URL should be set to the URL of your application. If the base path of the auth routes is changed, the redirect URL should be updated accordingly.

Twitch provider configuration in auth instance

Import betterAuth and configure the Twitch provider by passing an object with clientId and clientSecret to the socialProviders option. Example: import { betterAuth } from "better-auth"; export const auth = betterAuth({ socialProviders: { twitch: { clientId: process.env.TWITCH_CLIENT_ID as string, clientSecret: process.env.TWITCH_CLIENT_SECRET as string, } } })

Twitch sign-in client implementation

To sign in with Twitch, use the signIn.social function from the auth client with provider set to "twitch". Example: import { createAuthClient } from "better-auth/client"; const authClient = createAuthClient(); const signIn = async () => { const data = await authClient.signIn.social({ provider: "twitch" }) }

Twitch users without email address cannot sign in

Twitch users who do not have an email address will not be able to sign in through Better Auth.

Give your agent this brain