Configuration
Customize your Sushify Next.js application settings and preferences
Sushify Next.js provides a powerful configuration system that lets you tailor every aspect of your application to fit your requirements. All settings are managed through a centralized configuration file, making it simple to adjust your project's behavior.
Configuration File
All configuration options are defined in the config/index.ts file at the root of your project. This file exports a config object that contains all the settings for your application.
export const config = {
appName: "Sushify Next.js Demo",
domain: "sushify.dev",
// ... other configuration options
} as const satisfies Config;Configuration Options
App Information
Basic information about your application.
| Property | Type | Description |
|---|---|---|
appName | string | The name of your application, displayed throughout the UI |
domain | string | Your application's domain name |
Example:
{
appName: "Your App Name",
domain: "yourdomain.com",
}Internationalization (i18n)
Configure multi-language support for your application.
| Property | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable or disable internationalization features |
locales | Record<string, Locale> | - | Define available languages with their currency and display label |
defaultLocale | string | "en" | The default language used when no locale is selected |
defaultCurrency | string | "USD" | The default currency for pricing display |
localeCookieName | string | "NEXT_LOCALE" | Cookie name used to store the user's locale preference |
Example:
i18n: {
enabled: true,
locales: {
en: {
currency: "USD",
label: "English",
},
zh: {
currency: "USD",
label: "简体中文"
},
de: {
currency: "EUR",
label: "Deutsch",
},
},
defaultLocale: "en",
defaultCurrency: "USD",
localeCookieName: "NEXT_LOCALE",
}Tip: Even if you disable i18n, you still need to define at least one locale and set it as the default.
Organizations
Configure organization features for multi-tenant applications.
| Property | Type | Default | Description |
|---|---|---|---|
enable | boolean | true | Enable organization features |
enableBilling | boolean | false | Allow billing at the organization level |
hideOrganization | boolean | false | Hide organization UI for single-tenant applications |
enableUsersToCreateOrganizations | boolean | true | Allow users to create new organizations |
requireOrganization | boolean | false | Require users to be in an organization |
forbiddenOrganizationSlugs | string[] | [] | Reserved slugs that cannot be used as organization names |
Example:
organizations: {
enable: true,
enableBilling: false,
hideOrganization: false,
enableUsersToCreateOrganizations: true,
requireOrganization: false,
forbiddenOrganizationSlugs: [
"new-organization",
"admin",
"settings",
],
}Important: Add all your app routes to
forbiddenOrganizationSlugsto avoid routing conflicts.
Common Use Cases:
Multi-tenant SaaS:
organizations: {
enable: true,
enableBilling: true,
enableUsersToCreateOrganizations: true,
}Hidden Organizations (Single Tenant):
organizations: {
enable: true,
hideOrganization: true,
enableUsersToCreateOrganizations: false,
}Users
Configure user-specific settings.
| Property | Type | Default | Description |
|---|---|---|---|
enableBilling | boolean | true | Enable billing at the user level instead of organization level |
enableOnboarding | boolean | true | Show onboarding flow after user signup |
Example:
users: {
enableBilling: true,
enableOnboarding: true,
}Note: You can enable billing for either users OR organizations, but typically not both.
Authentication
Configure authentication methods and behavior.
| Property | Type | Default | Description |
|---|---|---|---|
enableSignup | boolean | true | Allow new user registrations |
enableMagicLink | boolean | true | Enable passwordless email login |
enableSocialLogin | boolean | true | Enable OAuth providers (GitHub, Google, etc.) |
enablePasskeys | boolean | true | Enable WebAuthn/passkey authentication |
enablePasswordLogin | boolean | true | Enable traditional password authentication |
enableTwoFactor | boolean | true | Allow users to enable two-factor authentication |
redirectAfterSignIn | string | "/app" | Path to redirect after successful login |
redirectAfterLogout | string | "/" | Path to redirect after logout |
sessionCookieMaxAge | number | 2592000 | Session duration in seconds (default: 30 days) |
Example:
auth: {
enableSignup: true,
enableMagicLink: true,
enableSocialLogin: true,
enablePasskeys: true,
enablePasswordLogin: true,
enableTwoFactor: true,
redirectAfterSignIn: "/app",
redirectAfterLogout: "/",
sessionCookieMaxAge: 60 * 60 * 24 * 30, // 30 days
}Example Configurations:
Passwordless Only:
auth: {
enablePasswordLogin: false,
enableMagicLink: true,
enablePasskeys: true,
}Social Login Only:
auth: {
enablePasswordLogin: false,
enableMagicLink: false,
enableSocialLogin: true,
}Email (Mails)
Configure email service provider.
| Property | Type | Description |
|---|---|---|
provider | "resend" | "mailgun" | "postmark" | "plunk" | "nodemailer" | "console" | "custom" | Email service provider |
from | string | The sender email address for all outgoing emails |
Example:
mails: {
provider: "resend",
from: "noreply@yourdomain.com",
}Note: Make sure to configure the corresponding environment variables for your chosen provider. See Installation for details.
Frontend (UI)
Configure the user interface and themes.
| Property | Type | Default | Description |
|---|---|---|---|
enabledThemes | ("light" | "dark")[] | ["light", "dark"] | Available theme options |
defaultTheme | "light" | "dark" | "light" | Default theme when user first visits |
saas.enabled | boolean | true | Enable the SaaS application routes |
saas.useSidebarLayout | boolean | true | Use sidebar navigation instead of top navigation |
marketing.enabled | boolean | true | Enable marketing pages |
Example:
ui: {
enabledThemes: ["light", "dark"],
defaultTheme: "light",
saas: {
enabled: true,
useSidebarLayout: true,
},
marketing: {
enabled: true,
},
}Common Use Cases:
SaaS Only (No Marketing Pages):
ui: {
saas: { enabled: true },
marketing: { enabled: false },
}Marketing Only (Landing Page):
ui: {
saas: { enabled: false },
marketing: { enabled: true },
}Storage
Configure file storage buckets.
| Property | Type | Description |
|---|---|---|
bucketNames.avatars | string | Bucket name for user/organization avatars |
Example:
storage: {
bucketNames: {
avatars: "avatars",
},
}You can add additional bucket names as needed for your application.
Contact Form
Configure the contact form feature.
| Property | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable the contact form on your marketing pages |
to | string | - | Email address where contact form submissions are sent |
subject | string | - | Subject line for contact form emails |
Example:
contactForm: {
enabled: true,
to: "hello@your-domain.com",
subject: "Contact form message",
}Payments
Configure payment provider and pricing plans.
| Property | Type | Description |
|---|---|---|
provider | "stripe" | "lemon-squeezy" | "paddle" | "custom" | Payment service provider |
plans | Record<string, Plan> | Define your pricing plans |
Plan Structure:
| Property | Type | Description |
|---|---|---|
recommended | boolean | Show a "Recommended" badge on this plan |
prices | Price[] | Array of price options for this plan |
Price Structure:
| Property | Type | Description |
|---|---|---|
type | "one-time" | "recurring" | Payment type |
productId | string | Product/Price ID from your payment provider |
amount | number | Price amount |
currency | string | Currency code (e.g., "USD", "EUR") |
Example:
payments: {
provider: "stripe",
plans: {
lifetime: {
recommended: true,
prices: [
{
type: "one-time",
productId: process.env.NEXT_PUBLIC_PRICE_ID,
amount: 199,
currency: "USD",
},
],
},
},
}Note: Make sure to configure the corresponding environment variables for your chosen payment provider.
Affiliate
Configure affiliate program integration.
| Property | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable affiliate program tracking |
provider | "rewardful" | "promotekit" | - | Affiliate service provider |
Example:
affiliate: {
enabled: true,
provider: "rewardful",
}Important: Affiliate functionality currently only works with Stripe as the payment provider.
Common Configuration Scenarios
Scenario 1: Simple SaaS with User Billing
{
organizations: { enable: false },
users: { enableBilling: true },
auth: { enableSignup: true },
ui: {
saas: { enabled: true },
marketing: { enabled: true },
},
}Scenario 2: Multi-tenant B2B SaaS
{
organizations: {
enable: true,
enableBilling: true,
requireOrganization: true,
},
users: { enableBilling: false },
ui: {
saas: { enabled: true, useSidebarLayout: true },
marketing: { enabled: true },
},
}Scenario 3: Marketing Page Only
{
organizations: { enable: false },
users: { enableBilling: false },
ui: {
saas: { enabled: false },
marketing: { enabled: true },
},
}Scenario 4: Invite-Only Application
{
auth: {
enableSignup: false,
enableSocialLogin: false,
},
organizations: {
enableUsersToCreateOrganizations: false,
},
}Type Safety
The configuration is fully typed using TypeScript. The Config type ensures that all configuration options are valid and helps prevent configuration errors.
import type { Config } from "./types";
export const config = {
// Your configuration
} as const satisfies Config;The as const assertion ensures that TypeScript treats the configuration values as literal types, providing better type inference throughout your application.
Environment Variables
Some configuration options reference environment variables for sensitive data:
storage: {
bucketNames: {
avatars: process.env.NEXT_PUBLIC_AVATARS_BUCKET_NAME ?? "avatars",
},
},
payments: {
plans: {
lifetime: {
prices: [{
productId: process.env.NEXT_PUBLIC_PRICE_ID,
}],
},
},
},Make sure to define these in your .env.local file. See Environment Setup for complete details.