Roblox social login
A web application needs users to authenticate with Roblox accounts.
Better Auth · Const
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" }).
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.
socialProviders: { roblox: { clientId: string, clientSecret: string } }
signIn.social({ provider: "roblox" })| Name | Type | Description |
|---|---|---|
clientId | string | OAuth client identifier obtained from Roblox Creator Hub. |
clientSecret | string | OAuth client secret obtained from Roblox Creator Hub. |
provider | "roblox" | Social provider selector for sign-in; set to roblox. |
The page does not specify a return type or return value for the Roblox provider configuration or sign-in example.
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.
A web application needs users to authenticate with Roblox accounts.
A local Better Auth server is being connected to a Roblox OAuth application.
A production application offers Roblox as an additional sign-in method.
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.
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.
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.
socialProviderssignIn.socialclientIdclientSecretcreateAuthClientbetterAuth