Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Better Auth · Const

reddit

reddit is Better Auth’s provider identifier for Reddit OAuth sign-in. Configure Reddit credentials under socialProviders.reddit, then pass provider: "reddit" to signIn.social.

How it works

The reddit identifier selects Better Auth's Reddit OAuth provider. Add Reddit credentials under socialProviders.reddit, then pass provider: "reddit" to the client's social sign-in method to begin authentication.

Syntax

provider: "reddit"

Parameters

NameTypeDescription
providerstringThe configured social provider to use; for this integration, set it to reddit.

Returns

The page does not specify a distinct return type; the sign-in example awaits the result of authClient.signIn.social.

Key points

  • Register Reddit under the auth instance's socialProviders configuration.
  • Supply the Reddit client ID through the provider's clientId option.
  • Supply the Reddit client secret through the provider's clientSecret option.
  • Start the client-side flow by passing an options object to the social sign-in method.
  • Use the provider property to choose the social provider.
  • The provider supports Reddit permission scopes such as identity, read, submit, subscribe, and history.

Common mistakes

  • Reddit sign-in requires both a client ID and a client secret.
  • Create the Reddit application as a web app.
  • The social sign-in provider value must be exactly reddit.

Example: Configure Reddit sign-in

import { betterAuth } from "better-auth";
import { createAuthClient } from "better-auth/client";

export const auth = betterAuth({
  socialProviders: {
    reddit: {
      clientId: process.env.REDDIT_CLIENT_ID as string,
      clientSecret: process.env.REDDIT_CLIENT_SECRET as string,
    },
  },
});

const authClient = createAuthClient();
await authClient.signIn.social({ provider: "reddit" });

Configure Reddit credentials on the server, then start OAuth sign-in with the Reddit provider identifier.

When to use it

Social sign-in

Users authenticate with Reddit instead of creating a local password.

Request Reddit scopes

An application needs Reddit account or content permissions.

Configure Reddit OAuth

A server configures OAuth credentials for a Reddit web application.

Interview questions

QHow do you enable Reddit sign-in?

The reddit value identifies Reddit in Better Auth's social-provider configuration and sign-in API. Configure clientId and clientSecret in socialProviders.reddit, then call signIn.social with provider: "reddit".

Follow-up: What credentials are required? Reddit requires a client ID and client secret, obtained from the Reddit Developer Portal.

QWhat redirect URL should be registered?

The redirect URL must point to Better Auth's Reddit callback route. For local development, the documented route is http://localhost:3000/api/auth/callback/reddit; production should use the application's domain.

Follow-up: Why must the production URL differ? OAuth providers redirect users back to the registered application domain, so the production callback must match that deployment.

QHow are Reddit permissions configured?

Provider scopes are configured inside the Reddit provider options with the scope array. Examples include identity for basic account information, read for posts and comments, and submit for submitting posts and comments.

Follow-up: How would you request additional Reddit permissions? Add the required Reddit scope names to the provider's scope array.

  • socialProviders
  • clientId
  • clientSecret
  • signIn.social
  • scope
  • createAuthClient

Source: Sign In with Reddit. Checked 2026-10-15.