Configuration
Learn how to configure your application using the configuration files.
The Pro Next.js Drizzle starter kit uses a modular configuration system that allows you to customize your application to your needs. Configuration is split into separate files in the config/ directory, making it easy to manage different aspects of your application.
App Configuration
Authentication Configuration
Billing Configuration
Storage Configuration
Configuration Structure
Configuration files are located in the config/ directory:
config/
├── app.config.ts # App-wide settings (name, themes, site sections)
├── auth.config.ts # Authentication settings (redirects, CORS, signup)
├── billing.config.ts # Billing and plans configuration
└── storage.config.ts # Storage bucket configurationUsing Configuration
Configuration objects are exported from each file and can be imported where needed:
import { appConfig } from '@/config/app.config';
export function getAppName() {
return appConfig.appName;
}Configuration Principles
Type Safety
All configuration objects use TypeScript's satisfies keyword to ensure type safety while preserving literal types. This gives you autocomplete and type checking.
Environment Variables
Configuration files can read from environment variables using the env object
from @/lib/env. This keeps sensitive values out of your code.
Modular Design
Each configuration file focuses on a specific domain (app, auth, billing, storage), making it easy to find and modify settings.
Default Values
Configuration files provide sensible defaults, but you can override them to match your needs.
Common Use Cases
Disable Marketing Site
If you want to deploy only the SaaS application without the marketing site:
export const appConfig = {
// ... other config
site: {
marketing: {
enabled: false // Disables marketing routes
},
saas: {
enabled: true
}
}
};Disable SaaS Application
If you want to deploy only the marketing site:
export const appConfig = {
// ... other config
site: {
marketing: {
enabled: true
},
saas: {
enabled: false // Disables SaaS routes
}
}
};Gate the Starter Signup Page
Set enableSignup to false to hide signup links in the starter auth cards and
require a valid, pending invitation when someone opens the starter signup page:
export const authConfig = {
// ... other config
enableSignup: false // Gate the starter signup page by invitation
};This setting is a UI and page-route gate. It does not block direct requests to Better Auth's signup endpoint. Add server-side invitation validation in your auth layer before describing the application as strictly invitation-only.
Gate the Starter Organization Creation Path
To block non-admin organization creation through the starter's
trpc.organization.create procedure:
export const appConfig = {
// ... other config
organizations: {
allowUserCreation: false // Guard the starter tRPC creation procedure
}
};This setting does not configure Better Auth's organization endpoint. Passing
allowUserToCreateOrganization: false to the Better Auth organization
plugin disables creation through that endpoint for everyone. Use a function
that returns true for allowed users if you want to preserve an admin
exception.
Next Steps
Explore the individual configuration files to learn more about each area:
- App Configuration - App-wide settings
- Authentication Configuration - Auth settings
- Billing Configuration - Plans and pricing
- Storage Configuration - Storage buckets