All configuration options for the Storefront SDK — API URL, keys, timeouts, retries, caching, and logging.
The createStorefrontSDK() function accepts a configuration object that controls authentication, network behavior, and debugging.
Configuration Interface
interface StorefrontConfig { apiUrl: string; // API base URL publicKey: string; // Public key for store identification secretKey?: string; // Secret key (server-side only, enables HMAC) environment?: 'production' | 'development'; // Default: 'production' version?: string; // API version (default: '1.0.0') timeout?: number; // Request timeout in ms (default: 30000) maxRetries?: number; // Maximum retry attempts (default: 3) retryDelay?: number; // Delay between retries in ms (default: 1000) enableLogging?: boolean; // Enable debug logging (default: false)}
Options Reference
apiUrl
Required. The base URL of the Storefront API.The default and most common value is https://front.rmz.gg/api. This is the production endpoint used by all RMZ stores.
Required. Your store’s public key. Found in the store dashboard under API settings. This key is safe to expose in client-side code.
secretKey
Optional. Server-side only. Your store’s secret key. When provided, the SDK generates HMAC-SHA256 signatures for every request. Required for Management API endpoints.
Never include secretKey in client-side code. The SDK will log a warning if it detects a secret key in a browser environment.
environment
Optional. Default: 'production'.Controls environment-specific behavior. In 'development' mode, error messages may be more verbose.
timeout
Optional. Default: 30000 (30 seconds).Maximum time in milliseconds to wait for a response before the request is aborted.
Optional. Default: 3.Number of times to retry a failed request before throwing an error. Retries are triggered on network errors and 5xx server errors.
retryDelay
Optional. Default: 1000 (1 second).Delay in milliseconds between retry attempts.
enableLogging
Optional. Default: false.When enabled, the SDK logs internal operations to the console (initialization, token updates, request details). Useful during development.