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

Better Auth · Const

roblox

Better Auth's Roblox provider enables Roblox OAuth sign-in through socialProviders. Configure Roblox credentials, use the documented callback URL, and start login with signIn.social({ provider: "roblox" }).

How it works

The Roblox provider is enabled by placing its client ID and secret under the auth instance's socialProviders configuration. The client starts authentication with signIn.social and provider set to roblox; because Roblox does not return email addresses, Better Auth derives a non-routable placeholder address from the stable sub claim.

Syntax

socialProviders: { roblox: { clientId: string, clientSecret: string } }

signIn.social({ provider: "roblox" })

Parameters

NameTypeDescription
clientIdstringOAuth client identifier obtained from Roblox Creator Hub.
clientSecretstringOAuth client secret obtained from Roblox Creator Hub.
provider"roblox"Social provider selector for sign-in; set to roblox.

Returns

The page does not specify a return type or return value for the Roblox provider configuration or sign-in example.

Key points

  • Create or retrieve the OAuth credentials in Roblox Creator Hub before configuring Better Auth.
  • Register Roblox inside the auth instance's socialProviders configuration rather than as a standalone setting.
  • The client sign-in call receives an options object, allowing the provider to be selected explicitly.
  • Set the sign-in options provider field to the literal value roblox.
  • When an email is needed, the generated address is based on Roblox's stable sub claim and is intentionally non-routable.

Common mistakes

  • Do not expect a usable email address from Roblox; Better Auth supplies a placeholder address instead.
  • The Roblox application redirect URL must match Better Auth's callback route during local development.
  • A custom auth route base path requires the Roblox redirect URL to be changed to the corresponding callback path.

Example: Configure and sign in with Roblox

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

export const auth = betterAuth({
  socialProviders: {
    roblox: {
      clientId: process.env.ROBLOX_CLIENT_ID as string,
      clientSecret: process.env.ROBLOX_CLIENT_SECRET as string,
    },
  },
});

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

Configure Roblox with its client credentials, then start OAuth sign-in through the client using the Roblox provider name.

When to use it

Roblox social login

A web application needs users to authenticate with Roblox accounts.

Local OAuth development

A local Better Auth server is being connected to a Roblox OAuth application.

Production social authentication

A production application offers Roblox as an additional sign-in method.

Interview questions

QHow do you configure Roblox OAuth in Better Auth?

Add a roblox entry beneath socialProviders in betterAuth, supplying clientId and clientSecret. The client can then call signIn.social with provider set to roblox.

Follow-up: What happens if the provider's profile has no email? Better Auth uses the stable sub claim to construct a non-routable placeholder address.

QWhich redirect URL should be configured for Roblox?

Use the local callback URL http://localhost:3000/api/auth/callback/roblox for local development. In production, configure the callback as the application's deployed URL.

Follow-up: What must change when the auth route base path changes? Update the Roblox redirect URL so it points to the new callback route.

QHow is Roblox sign-in started from the client?

Call authClient.signIn.social with an object whose provider property is roblox. This initiates sign-in through the configured Roblox social provider.

Follow-up: What provider-specific data limitation should be handled? Roblox does not provide email addresses, so application logic should not require a routable Roblox email.

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

Source: Roblox. Checked 2026-10-15.