Global configuration


Setup

Generic configuration for several APIs.

export const CONFIG: ConfigValue = {
  appName: 'Minimal UI', // Application name
  appVersion: packageJson.version, // Application version from package.json
  serverUrl: process.env.NEXT_PUBLIC_SERVER_URL ?? '', // Server URL from environment variables
  assetsDir: process.env.NEXT_PUBLIC_ASSETS_DIR ?? '', // Assets directory from environment variables
  isStaticExport: JSON.parse(`${process.env.BUILD_STATIC_EXPORT}`), // Static export option (next.config.mjs)
  /**
   * Auth
   * @method jwt | amplify | firebase | supabase | auth0
   */
  auth: {
    method: 'jwt', // Authentication method
    skip: false, // Skip authentication
    redirectPath: paths.dashboard.root, // Redirect path after authentication
  },
  /**
   * Mapbox
   */
  mapboxApiKey: process.env.NEXT_PUBLIC_MAPBOX_API_KEY ?? '', // Mapbox API key from environment variables
  /**
   * Firebase
   */
  firebase: {
    apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY ?? '', // Firebase API key from environment variables
    authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN ?? '', // Firebase Auth Domain from environment variables
    projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID ?? '', // Firebase Project ID from environment variables
    storageBucket: process.env.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET ?? '', // Firebase Storage Bucket from environment variables
    messagingSenderId: process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID ?? '', // Firebase Messaging Sender ID from environment variables
    appId: process.env.NEXT_PUBLIC_FIREBASE_APPID ?? '', // Firebase App ID from environment variables
    measurementId: process.env.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID ?? '', // Firebase Measurement ID from environment variables
  },
  /**
   * Amplify
   */
  amplify: {
    userPoolId: process.env.NEXT_PUBLIC_AWS_AMPLIFY_USER_POOL_ID ?? '', // AWS Amplify User Pool ID from environment variables
    userPoolWebClientId: process.env.NEXT_PUBLIC_AWS_AMPLIFY_USER_POOL_WEB_CLIENT_ID ?? '', // AWS Amplify User Pool Web Client ID from environment variables
    region: process.env.NEXT_PUBLIC_AWS_AMPLIFY_REGION ?? '', // AWS Amplify Region from environment variables
  },
  /**
   * Auth0
   */
  auth0: {
    clientId: process.env.NEXT_PUBLIC_AUTH0_CLIENT_ID ?? '', // Auth0 Client ID from environment variables
    domain: process.env.NEXT_PUBLIC_AUTH0_DOMAIN ?? '', // Auth0 Domain from environment variables
    callbackUrl: process.env.NEXT_PUBLIC_AUTH0_CALLBACK_URL ?? '', // Auth0 Callback URL from environment variables
  },
  /**
   * Supabase
   */
  supabase: {
    url: process.env.NEXT_PUBLIC_SUPABASE_URL ?? '', // Supabase URL from environment variables
    key: process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY ?? '', // Supabase Key from environment variables
  },
};

With static export option in next.js
next.config.mjs
const isStaticExport = 'true';