Why Self-Host?
Self-hosting Better Auth Studio provides several benefits:- Full Control: Deploy and manage the studio within your own infrastructure
- Production Ready: Run the admin interface alongside your production application
- Custom Branding: Apply your own branding, themes, and customization
- Access Control: Restrict access to specific roles or email addresses
- Framework Agnostic: Works with Next.js, Express, Hono, SvelteKit, Remix, Nuxt, and more
Installation
The CLI usage (standalone studio) can be installed as a dev dependency, but self-hosting requires it in
dependencies for production deployments.Quick Start
Initialize Configuration
Run the initialization command to create a This creates a configuration file in your project root:
studio.config.ts file:studio.config.ts
Set Up Framework Adapter
Choose your framework and follow the appropriate setup guide:
- Next.js (App Router)
- Express
- Other Frameworks (Hono, SvelteKit, Remix, Nuxt)
Configuration Options
TheStudioConfig type accepts the following options:
| Option | Type | Required | Description |
|---|---|---|---|
auth | BetterAuth | Yes | Your Better Auth instance |
basePath | string | Yes | URL path where studio is mounted (e.g., /api/studio) |
access | StudioAccessConfig | No | Access control configuration |
metadata | StudioMetadata | No | Custom branding and UI configuration |
lastSeenAt | StudioLastSeenAtConfig | No | Enable last-seen tracking |
ipAddress | StudioIpAddressConfig | No | IP geolocation for Events/Sessions |
events | EventsConfig | No | Event tracking configuration |
tools | ToolsConfig | No | Configure which tools to show/hide |
Supported Frameworks
Better Auth Studio provides adapters for all major frameworks:- Next.js - App Router with catch-all routes
- Express - Express.js middleware
- Hono - Hono framework handler
- SvelteKit - SvelteKit server routes
- Remix - Remix resource routes
- Nuxt - Nuxt server API routes
betterAuthStudio() function that creates a framework-specific handler.
Next Steps
Next.js Setup
Set up Better Auth Studio with Next.js App Router
Express Setup
Integrate with Express.js applications
Other Frameworks
Hono, SvelteKit, Remix, and Nuxt setup guides
Configuration
Learn about all configuration options