LogoMkSaaS Docs

Website Configuration

Core settings for your MkSaaS website

The main configuration file that contains the core settings for the website.

MkSaaS boilerplate has already set up the default core settings for you, and you can customize the core settings in this file src/config/website.tsx.

src/config/website.tsx
export const websiteConfig: WebsiteConfig = {
  metadata: {
    // Theme, mode, images, and social settings
  },
  features: {
    // Features settings
  },
  routes: {
    // Routes settings
  },
  analytics: {
    // Analytics settings
  },
  auth: {
    // Auth settings
  },
  i18n: {
    // Internationalization settings
  },
  blog: {
    // Blog settings
  },
  mail: {
    // Mail settings
  },
  newsletter: {
    // Newsletter settings
  },
  storage: {
    // Storage settings
  },
  payment: {
    // Payment settings
  },
  price: {
    // Price settings
  },
  credits: {
    // Credits settings
  },
};

Metadata

Controls the appearance and branding of your website. The metadata configuration consists of several subsections:

Theme

Controls the color theme of the website:

PropertyTypeDescription
defaultTheme'default' | 'blue' | 'green' | 'amber' | 'neutral'Sets the default color theme for the website
enableSwitchbooleanWhen true, allows users to change the color theme

Example:

src/config/website.tsx
metadata: {
  theme: {
    defaultTheme: 'default', // Choose from: default, blue, green, amber, neutral
    enableSwitch: true,      // Allow users to switch themes
  },
  // ...
}

You can find more about customizing the theme in the Theme Configuration documentation.

Mode

Controls the light/dark mode settings:

PropertyTypeDescription
defaultMode'light' | 'dark' | 'system'Sets the default display mode
enableSwitchbooleanWhen true, allows users to toggle between light/dark modes

Example:

src/config/website.tsx
metadata: {
  mode: {
    defaultMode: 'system', // Choose from: light, dark, system
    enableSwitch: true,    // Allow users to switch modes
  },
  // ...
}

Images

Defines the images used for branding and social sharing:

PropertyTypeDescription
ogImagestringURL to the Open Graph image used for social media previews
logoLightstringURL to your logo image for light mode
logoDarkstringURL to your logo image for dark mode

Example:

src/config/website.tsx
metadata: {
  images: {
    ogImage: '/og.png',      // Open Graph image for social sharing
    logoLight: '/logo.png',  // Logo displayed in light mode
    logoDark: '/logo-dark.png', // Logo displayed in dark mode
  },
  // ...
}

You can find more about customizing the images in the Images Configuration documentation.

Social Media

Configure links to your social media profiles:

PropertyTypeDescription
twitterstringURL to Twitter/X profile
githubstringURL to GitHub profile or repository
discordstringURL to Discord server
blueSkystringURL to BlueSky profile
youtubestringURL to YouTube channel
linkedinstringURL to LinkedIn profile or page
facebookstringURL to Facebook page
instagramstringURL to Instagram profile
tiktokstringURL to TikTok profile

Example:

src/config/website.tsx
metadata: {
  social: {
    github: 'https://github.com/YourOrganization',
    twitter: 'https://twitter.com/YourHandle',
    discord: 'https://discord.gg/your-invitation-code',
    youtube: 'https://youtube.com/@YourChannel',
    // Add other social platforms as needed
  },
  // ...
}

These social media links are used by the social-config.tsx file to generate the appropriate icon links across the website.

Features

Configure the features for some cases, for example, whether to show upgrade card or not:

PropertyTypeDescription
enableDiscordWidgetbooleanWhether to enable the Discord widget or not, deprecated, default is false
enableCrispChatbooleanWhether to enable the Crisp chat or not, default is true
enableUpgradeCardbooleanWhether to enable the upgrade card or not, default is true
enableAffonsoAffiliatebooleanWhether to enable the affonso affiliate or not, default is false
enablePromotekitAffiliatebooleanWhether to enable the promotekit affiliate or not, default is false
enableDatafastRevenueTrackbooleanWhether to enable the datafast revenue track or not, default is false
enableTurnstileCaptchabooleanWhether to enable the Cloudflare Turnstile captcha or not, default is false

Example:

src/config/website.tsx
features: {
  enableDiscordWidget: false,
  enableCrispChat: process.env.NEXT_PUBLIC_DEMO_WEBSITE === 'true',
  enableUpgradeCard: true,
  enableAffonsoAffiliate: false,
  enablePromotekitAffiliate: false,
  enableDatafastRevenueTrack: false,
  enableTurnstileCaptcha: process.env.NEXT_PUBLIC_DEMO_WEBSITE === 'true',
}

Routes

Configure the routes for some cases, for example, the default login redirect route:

PropertyTypeDescription
defaultLoginRedirectstringThe default login redirect route, default is /dashboard

Example:

src/config/website.tsx
routes: {
  defaultLoginRedirect: '/settings/profile',
}

Analytics

Configure analytics services for your website:

PropertyTypeDescription
enableVercelAnalyticsbooleanWhen true, enables Vercel Web Analytics
enableSpeedInsightsbooleanWhen true, enables Vercel Speed Insights

Example:

src/config/website.tsx
analytics: {
  enableVercelAnalytics: true,  // Enable Vercel Web Analytics
  enableSpeedInsights: true,    // Enable Vercel Speed Insights
}

Vercel Analytics and Speed Insights are privacy-friendly analytics tools that don't require cookie banners. They provide insights into your website's performance and user behavior.

To enable these services:

  1. Go to your Vercel project dashboard
  2. Navigate to the Analytics tab
  3. Enable Web Analytics and/or Speed Insights
  4. Set the corresponding configuration options to true

For more details, see the Analytics documentation.

Auth

Configure authentication options for your website:

PropertyTypeDescription
enableGoogleLoginbooleanWhen true, enables Google as a login provider
enableGithubLoginbooleanWhen true, enables GitHub as a login provider
enableCredentialLoginbooleanWhen true, enables credential login

Example:

src/config/website.tsx
auth: {
  enableGoogleLogin: true,  // Allow Google login
  enableGithubLogin: true,  // Allow GitHub login
  enableCredentialLogin: true,  // Allow credential login
}

MkSaaS supports multiple authentication providers by default. You can selectively disable specific providers using these configuration options:

  • Set enableGoogleLogin to false to remove Google as a login option
  • Set enableGithubLogin to false to remove GitHub as a login option
  • Set enableCredentialLogin to false to remove credential login

Note: Please ensure at least one login method is enabled, otherwise users will not be able to log in.

Internationalization (i18n)

Configure language support for your application:

PropertyTypeDescription
defaultLocalestringDefault language locale (e.g., 'en')
localesRecord<string, { flag?: string; name: string }>Available languages with flag emoji and display name

MkSaaS supports multiple languages through its i18n system. Here's how to configure it:

src/config/website.tsx
i18n: {
  defaultLocale: 'en',
  locales: {
    en: {
      flag: '🇺🇸',
      name: 'English',
    },
    zh: {
      flag: '🇨🇳',
      name: '中文',
    },
    // Add more languages as needed
  },
}

For each supported language:

  • The key is the locale code (e.g., en, es, fr)
  • flag is an optional emoji to visually represent the language
  • name is the display name of the language in its native form

When adding a new language, you'll also need to create the corresponding translation files in the messages directory to provide translations for all UI strings. The application will use these translations to display content in the user's selected language.

Blog

Configure the blog functionality:

PropertyTypeDescription
paginationSizenumberNumber of posts to display per page
relatedPostsSizenumberNumber of related posts to show

Example:

src/config/website.tsx
blog: {
  paginationSize: 6,
  relatedPostsSize: 3,
}

Mail

Configure email services:

PropertyTypeDescription
provider'resend'Email service provider (currently only Resend is supported)
contactstringContact email for sending and receiving emails

Example:

mail: {
  provider: 'resend',
  contact: 'contact@example.com',
}

Newsletter

Configure newsletter services:

PropertyTypeDescription
provider'resend'Newsletter service provider (currently only Resend is supported)
autoSubscribeAfterSignUpbooleanWhether to automatically subscribe users after sign up

Example:

src/config/website.tsx
newsletter: {
  provider: 'resend',
  autoSubscribeAfterSignUp: true,
}

Storage

Configure file storage:

PropertyTypeDescription
provider's3'Storage provider (currently only S3 is supported)

Example:

src/config/website.tsx
storage: {
  provider: 's3',
}

Payment

Configure payment processing services:

PropertyTypeDescription
provider'stripe'Payment processor (currently only Stripe is supported)

Example:

src/config/website.tsx
payment: {
  provider: 'stripe',
}

Price

Configure price plans:

PropertyTypeDescription
plansRecord<string, PricePlan>Pricing plans configuration

Each price plan in the plans object can have the following properties:

PropertyTypeDescription
idstringUnique identifier for the plan
namestring?Display name of the plan
descriptionstring?Description of the plan features
featuresstring[]?List of features included in this plan
limitsstring[]?List of limits for this plan
pricesPrice[]List of price options for the plan (monthly, yearly, one-time, etc.)
isFreebooleanWhether this is a free plan
isLifetimebooleanWhether this is a lifetime (one-time payment) plan
popularboolean?Whether to highlight this plan as popular
disabledboolean?Whether to disable this plan in UI
creditsobject?Credits configuration for this plan

The prices array contains objects with the following structure:

PropertyTypeDescription
type'subscription' | 'one_time'Type of payment (subscription or one-time)
priceIdstringStripe price ID (not product ID)
amountnumberPrice amount in currency units (dollars, euros, etc.)
currencystringCurrency code (e.g., USD)
interval'month' | 'year'?Billing interval for recurring payments
trialPeriodDaysnumber?Free trial period in days
allowPromotionCodeboolean?Whether to allow promotion code for this price
disabledboolean?Whether to disable this price in UI

The structure of credits object:

PropertyTypeDescription
enablebooleanWhether to enable credits
amountnumberNumber of credits
expireDaysnumber?Expiration period (days) for the credits, optional

MkSaaS boilerplate uses three price plans by default: Free plan, Pro subscription plan (monthly/yearly), and Lifetime plan (one-time payment), as shown in the website configuration:

src/config/website.tsx
price: {
  plans: {
    free: {
      id: 'free',
      prices: [],
      isFree: true,
      isLifetime: false,
      credits: {
        enable: true,
        amount: 50,
        expireDays: 30,
      },
    },
    pro: {
      id: 'pro',
      prices: [
        {
          type: PaymentTypes.SUBSCRIPTION,
          priceId: process.env.NEXT_PUBLIC_STRIPE_PRICE_PRO_MONTHLY!,
          amount: 990,
          currency: 'USD',
          interval: PlanIntervals.MONTH,
        },
        {
          type: PaymentTypes.SUBSCRIPTION,
          priceId: process.env.NEXT_PUBLIC_STRIPE_PRICE_PRO_YEARLY!,
          amount: 9900,
          currency: 'USD',
          interval: PlanIntervals.YEAR,
        },
      ],
      isFree: false,
      isLifetime: false,
      popular: true,
      credits: {
        enable: true,
        amount: 1000,
        expireDays: 30,
      },
    },
    lifetime: {
      id: 'lifetime',
      prices: [
        {
          type: PaymentTypes.ONE_TIME,
          priceId: process.env.NEXT_PUBLIC_STRIPE_PRICE_LIFETIME!,
          amount: 19900,
          currency: 'USD',
          allowPromotionCode: true,
        },
      ],
      isFree: false,
      isLifetime: true,
      credits: {
        enable: true,
        amount: 1000,
        expireDays: 30,
      },
    },
  },
},

When to set plans or prices as disabled?

  • Set a plan to disabled: true when the plan is not available for new customers, but you need to keep it for existing users who have already purchased it.

  • Set a price to disabled: true when that specific pricing option is not available anymore, but existing subscribers on that price should still be able to see it in the billing page.

When displaying plans to users, the Price Configuration enhances these plans with translated content such as name, description, and feature lists.

Credits

Configure the credit system for your website:

PropertyTypeDescription
enableCreditsbooleanWhether to enable the credit system
enableForFreePlanbooleanWhether free plan users can purchase credits (by default, only paid users can buy extra credit packages)
registerGiftCreditsobjectConfiguration for registration gift credits
packagesRecord<string, CreditPackage>Configurable credit packages for purchase

The structure of registerGiftCredits object:

PropertyTypeDescription
enablebooleanWhether to enable registration gift credits
creditsnumberNumber of credits given on registration
expireDaysnumber?Expiry period (days) for the gifted credits, optional

The structure of each credit package in packages:

PropertyTypeDescription
idstringUnique identifier for the package
namestring?Display name of the package
descriptionstring?Description of the package
popularbooleanWhether this package is recommended
creditsnumberNumber of credits included in the package
priceobjectPrice info, including priceId, amount, currency, allowPromotionCode
expireDaysnumber?Validity period (days) for the credits, optional, undefined means no expire
disabledboolean?Whether to disable this package in UI, optional

Example:

src/config/website.tsx
credits: {
  enableCredits: false,
  enableForFreePlan: false,
  registerGiftCredits: {
    enable: true,
    credits: 50,
    expireDays: 30,
  },
  packages: {
    basic: {
      id: 'basic',
      popular: false,
      credits: 100,
      expireDays: 30,
      price: {
        priceId: process.env.NEXT_PUBLIC_STRIPE_PRICE_CREDITS_BASIC!,
        amount: 990,
        currency: 'USD',
        allowPromotionCode: true,
      },
    },
    // ... other credit packages ...
  },
},

Next Steps

Now that you understand the website configuration, explore these related topics: