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/reddit

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.

Reddit client ID and secret from Developer Portal

To use Reddit sign in, obtain a client ID and client secret from the Reddit Developer Portal at https://www.reddit.com/prefs/apps by clicking 'Create App' or 'Create Another App'.

Reddit app setup as web app with redirect URL

When creating a Reddit app, select 'web app' as the application type. For local development, set the redirect URL to http://localhost:3000/api/auth/callback/reddit. For production, set it to your application's domain, such as https://example.com/api/auth/callback/reddit. If you change the base path of the auth routes, update the redirect URL accordingly.

Configure Reddit provider in auth instance

To configure Reddit as a social provider, import betterAuth and pass the Reddit provider to the socialProviders option. The configuration requires clientId and clientSecret as strings from environment variables: reddit: { clientId: process.env.REDDIT_CLIENT_ID as string, clientSecret: process.env.REDDIT_CLIENT_SECRET as string }

Sign in with Reddit using client

To sign in with Reddit, use the signIn.social function from the auth client with the provider set to 'reddit': authClient.signIn.social({ provider: 'reddit' })

Reddit OAuth scopes configuration

Reddit provider supports the following scopes: identity (access basic account information), read (access posts and comments), submit (submit posts and comments), subscribe (manage subreddit subscriptions), and history (access voting history). Scopes are specified in the auth configuration as an array in the scope property. By default, Reddit provides basic user information without additional scope specification.

Reddit provider duration option

The Reddit provider configuration supports a duration property which can be set to 'permanent' to request permanent authorization from Reddit.

Give your agent this brain