Documentation
Getting StartedConfiguration

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.

config/index.ts
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.

PropertyTypeDescription
appNamestringThe name of your application, displayed throughout the UI
domainstringYour application's domain name

Example:

{
  appName: "Your App Name",
  domain: "yourdomain.com",
}

Internationalization (i18n)

Configure multi-language support for your application.

PropertyTypeDefaultDescription
enabledbooleantrueEnable or disable internationalization features
localesRecord<string, Locale>-Define available languages with their currency and display label
defaultLocalestring"en"The default language used when no locale is selected
defaultCurrencystring"USD"The default currency for pricing display
localeCookieNamestring"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.

PropertyTypeDefaultDescription
enablebooleantrueEnable organization features
enableBillingbooleanfalseAllow billing at the organization level
hideOrganizationbooleanfalseHide organization UI for single-tenant applications
enableUsersToCreateOrganizationsbooleantrueAllow users to create new organizations
requireOrganizationbooleanfalseRequire users to be in an organization
forbiddenOrganizationSlugsstring[][]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 forbiddenOrganizationSlugs to 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.

PropertyTypeDefaultDescription
enableBillingbooleantrueEnable billing at the user level instead of organization level
enableOnboardingbooleantrueShow 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.

PropertyTypeDefaultDescription
enableSignupbooleantrueAllow new user registrations
enableMagicLinkbooleantrueEnable passwordless email login
enableSocialLoginbooleantrueEnable OAuth providers (GitHub, Google, etc.)
enablePasskeysbooleantrueEnable WebAuthn/passkey authentication
enablePasswordLoginbooleantrueEnable traditional password authentication
enableTwoFactorbooleantrueAllow users to enable two-factor authentication
redirectAfterSignInstring"/app"Path to redirect after successful login
redirectAfterLogoutstring"/"Path to redirect after logout
sessionCookieMaxAgenumber2592000Session 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.

PropertyTypeDescription
provider"resend" | "mailgun" | "postmark" | "plunk" | "nodemailer" | "console" | "custom"Email service provider
fromstringThe 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.

PropertyTypeDefaultDescription
enabledThemes("light" | "dark")[]["light", "dark"]Available theme options
defaultTheme"light" | "dark""light"Default theme when user first visits
saas.enabledbooleantrueEnable the SaaS application routes
saas.useSidebarLayoutbooleantrueUse sidebar navigation instead of top navigation
marketing.enabledbooleantrueEnable 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.

PropertyTypeDescription
bucketNames.avatarsstringBucket 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.

PropertyTypeDefaultDescription
enabledbooleantrueEnable the contact form on your marketing pages
tostring-Email address where contact form submissions are sent
subjectstring-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.

PropertyTypeDescription
provider"stripe" | "lemon-squeezy" | "paddle" | "custom"Payment service provider
plansRecord<string, Plan>Define your pricing plans

Plan Structure:

PropertyTypeDescription
recommendedbooleanShow a "Recommended" badge on this plan
pricesPrice[]Array of price options for this plan

Price Structure:

PropertyTypeDescription
type"one-time" | "recurring"Payment type
productIdstringProduct/Price ID from your payment provider
amountnumberPrice amount
currencystringCurrency 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.

PropertyTypeDefaultDescription
enabledbooleantrueEnable 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.