Feature Toggles

Enable or disable various features of the core

Type Definition

interface FeaturesConfig {
  /**
   * Enable auto-updater (default: true)
   */
  updater?: boolean;

  /**
   * Enable database (default: true)
   */
  database?: boolean;

  /**
   * Enable Sentry error monitoring (default: false)
   */
  sentry?: boolean;
}

Default Values

FeatureDefault
updatertrue
databasetrue
sentryfalse

Configuration Example

features: {
  updater: true,   // Enable auto-updater
  database: true,  // Enable SQLite database
  sentry: false,   // Disable Sentry
},

updater - Auto Updates

When enabled:

  • Automatically checks for updates on app startup
  • Settings page shows "Check for Updates" button
  • useUpdater hook is available

When disabled:

  • No update checks
  • Settings page hides update-related UI
  • useUpdater hook returns no-op functions
// Disable auto-updater
features: {
  updater: false,
},

Auto-updater requires configuring the updater endpoint in tauri.conf.json to work properly.

database - SQLite Database

When enabled:

  • Automatically initializes SQLite database
  • Executes core and app migrations
  • Database APIs are available

When disabled:

  • Database is not initialized
  • Database-related APIs will throw errors
// Disable database
features: {
  database: false,
},

When database is disabled, hooks like useSetting and useAppState cannot be used.

sentry - Error Monitoring

When enabled:

  • Initializes Sentry SDK
  • Automatically captures unhandled exceptions
  • captureError, setUser and other APIs are available

When disabled:

  • Sentry SDK is not loaded
  • Error monitoring APIs are no-ops
// Enable Sentry
features: {
  sentry: true,
},

sentry: {
  dsn: 'https://xxx@sentry.io/xxx',
  tracesSampleRate: 0.1,
},

Enabling Sentry also requires configuring sentry.dsn, otherwise it won't initialize.

Complete Example

export const config = {
  features: {
    updater: true,
    database: true,
    sentry: process.env.NODE_ENV === 'production',
  },

  // Required if sentry is enabled
  sentry: {
    dsn: import.meta.env.VITE_SENTRY_DSN,
    tracesSampleRate: 0.1,
  },
};