Skip to Content
DocumentationConfiguration

Configuration

The entire @harvide/starter boilerplate is configured through a single file: starter.config.ts. This file is located at the root of your project and allows you to customize everything from authentication to branding.

UI

Configure the UI components of your application.

ui.loginForm

  • Type: `“basic”
  • Default: "basic"

Specifies the variant of the login form to use.

ui.signupForm

  • Type: `“basic”
  • Default: "basic"

Specifies the variant of the signup form to use.


Email

Configure your email service for sending transactional emails like verification and password resets.

email.enabled

  • Type: boolean
  • Default: true

Enable or disable the email service.

email.provider

  • Type: "resend" | "mailgun" | "smtp"
  • Default: "resend"

The email provider to use.

email.from

  • Type: object

An object containing the default sender email addresses for different purposes.

  • admin: Default sender for admin-related emails.
    • email: Admin email address.
    • name: Admin sender name.
  • support: Default sender for support-related emails.
    • email: Support email address.
    • name: Support sender name.
  • noReply: Default sender for no-reply emails.
    • email: No-reply email address.

email.templates

  • Type: object

Configuration for email templates.

  • verification: Email verification template settings.
    • subject: Subject line for the verification email.
    • variant: Variant of the verification email template.
  • resetPassword: Password reset template settings.
    • subject: Subject line for the password reset email.
    • variant: Variant of the password reset email template.

Authentication (auth)

This is the core of the configuration, where you can enable, disable, and customize all authentication-related features.

Phone (auth.phone)

  • enabled: Enable or disable phone number authentication.
  • otp.enabled: Enable OTP verification for phone numbers.
  • otp.allowedAttempts: Maximum number of OTP verification attempts.
  • otp.otpLength: Length of the generated OTP code.
  • otp.expiresIn: Time in seconds before OTP expires.
  • otp.requireVerification: Require phone number verification before allowing account access.

Email & Password (auth.emailAndPassword)

  • enabled: Enable or disable email and password authentication.
  • autoSignIn: Automatically sign in user after email verification.
  • disableSignUp: Disable new user registration via email.
  • minPasswordLength: Minimum password length requirement.
  • maxPasswordLength: Maximum password length limit.
  • requireEmailVerification: Require email verification before allowing account access.
  • resetPasswordTokenExpiresIn: Time in seconds before password reset token expires.
  • verificationTokenExpiresIn: Time in seconds before email verification token expires.
  • sendEmailVerificationOnSignup: Send email verification after user signs up.
  • sendResetPassword: Enable password reset functionality.

auth.emailAndPassword.otp

  • enabled: Enable email OTP authentication.
  • otpLength: Length of the generated OTP code.
  • expiresIn: Time in seconds before OTP expires.
  • sendVerificationOnSignUp: Send verification code when user signs up.
  • disableSignUp: Disable new user registration via email OTP.
  • allowedAttempts: Maximum number of OTP verification attempts before lockout.

Social Providers (auth.socialProviders)

Configure third-party social login providers like Google, Apple, and LinkedIn. For this to work, you need to provide the clientId and clientSecret for each enabled provider.

  • apple: Apple Sign In configuration.
    • enabled: Enable or disable Apple Sign In.
    • clientId: Client ID for Apple.
    • clientSecret: Client Secret for Apple.
  • google: Google Sign In configuration.
    • enabled: Enable or disable Google Sign In.
    • clientId: Client ID for Google.
    • clientSecret: Client Secret for Google.
  • linkedin: LinkedIn Sign In configuration.
    • enabled: Enable or disable LinkedIn Sign In.
    • clientId: Client ID for LinkedIn.
    • clientSecret: Client Secret for LinkedIn.

Refer to the Better Auth OAuth docs for more details.

Account Linking (auth.account.accountLinking)

  • enabled: Allows users to link multiple social accounts to a single user account.
  • allowUnlinkingAll: If false, prevents users from unlinking their last remaining account to avoid lockout.

Admin Panel (admin)

  • enabled: Enable or disable the admin panel.
  • impersonationSessionDuration: The duration of the impersonation session in seconds.
  • defaultBanReason: The default ban reason for a user created by the admin.
  • defaultBanExpiresIn: The default ban duration in seconds.
  • bannedUserMessage: The message to show when a banned user tries to sign in.
  • dashboard.shortcuts: An array of objects to display as shortcuts in the admin panel’s top navigation bar.
  • dashboard.metrics: An array of objects to define the metrics displayed on the admin dashboard.

Branding (branding)

Customize your application’s name, description, and logo.

  • name: Your application’s name.
  • description: A short description for SEO and metadata.
  • logo.large: URL for the full-size logo.
  • logo.icon: URL for the favicon-sized logo.
  • logo.altText: Alt text for the logo, for accessibility.

Preferences (preferences)

showToasts

An object to control the visibility of different types of toast notifications (success, error, info, warning, debug).

preferences.placeholders

  • Type: object

An object containing placeholder values for various input fields.

  • email: Placeholder for email input.
  • password: Placeholder for password input.
  • phone: Placeholder for phone number input.
  • firstName: Placeholder for first name input.
  • lastName: Placeholder for last name input.
  • username: Placeholder for username input.

SEO and Metadata (seo)

Configure SEO and metadata settings for your application.

seo.title

  • Type: string
  • Default: "Harvide Starter"

Set the title of the application.

seo.description

  • Type: string
  • Default: "Never handle flows manually again. Use Harvide Starter to kickstart your next project with pre-configured authentication and UI components."

Application description, used in meta tags and documentation.

seo.keywords

  • Type: string[]

An array of keywords for SEO.

seo.canonicalUrl

  • Type: string

The canonical URL for the application.

seo.robots

  • Type: object

Robot exclusion standard configuration.

  • enabled: Enable or disable robots.txt generation.
  • rules: An array of rules for user agents.

seo.sitemap

  • Type: object

Sitemap configuration.

  • enabled: Enable or disable sitemap generation.
  • baseUrl: The base URL for the sitemap.

seo.openGraph

  • Type: object

Open Graph configuration for social media sharing.

  • enabled: Enable or disable Open Graph metadata.
  • imageUrl: URL to the Open Graph image.
  • imageAlt: Alt text for the Open Graph image.