Black Friday Sale 40% Off•Sale end soon

PaceUI

  • Components
  • Blocks
  • Templates
  • Studio
  • Resources
Docs
  • Introduction
  • Installation
Starter
  • Overview
  • Getting Started
  • Folder Structure
  • AI
  • Auth Basic
  • Auth OAuth
  • Database
  • Documentation
  • Email Resend
  • Payment Creem
  • Payment Polar
  • Storage
  1. Docs
PreviousNext

OAuth (Auth)

Google, GitHub, and other Better Auth social providers in the PaceUI Starter.

This guide shows how to enable social login in starter. Google and GitHub are ready by default, with support for other Better Auth providers.

1. Add Environment Variables

Set the Client ID and Client Secret from each provider’s developer console.

.env
# Google
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

# GitHub
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=

2. Update Your Auth Config

Add providers inside the social object. If a variable is missing, that provider simply won’t load.

auth.ts
export const auth = betterAuth({
  socialProviders: {
      google: {
          clientId: process.env.GOOGLE_CLIENT_ID,
          clientSecret: process.env.GOOGLE_CLIENT_SECRET,
      },
      // ... Other providers
  },
  // ...
});

3. Social Sign-In Component

A drop-in component is available for rendering social buttons.

SignIn.tsx
import { GoogleSignInButton } from "@/src/components/auth/social";

<GoogleSignInButton />;

4. Callback Handling

Better Auth wires up callbacks automatically. Just ensure the URLs are added in each provider’s dashboard.

Development:

Callback URL
http://localhost:3000/api/auth/callback/google

Production:

Callback URL
https://your-domain.com/api/auth/callback/google
Auth BasicDatabase

PaceUI

Animated blocks, components, and templates for Next.js and TanStack Start. Built with Motion and shadcn - clean code you own.

GitHubTwitterDiscord

Products

BlocksComponentsTemplatesCraftsTanStack ChartsMCP ServerStarter KitsStyleX Components

Resources

DocumentationMotion ComponentsGSAP AnimationsNative AIBlogChangelog

Pricing & Account

PricingManage AccountLicensesAPI KeysAffiliate Program

Company

Contact UsDiscord CommunityPrivacy PolicyTerms of Service

© 2026 PaceUI. All rights reserved. Built by indie developer, Denish

PACEUI