Configuration
This guide covers all configuration options for the Fanfare SDK, including the provider setup, environment configuration, and advanced options.Provider Configuration
React
Wrap your application withFanfareProvider at the root level:
SolidJS
For SolidJS, initialize the SDK first, then pass it to the provider:Vanilla JavaScript
For the core SDK without a framework, callinit directly:
Required Configuration
organizationId
Your Fanfare organization identifier. Find this in your Fanfare dashboard under Settings > API Keys.org_.
publishableKey
Your publishable API key for client-side use. This key is safe to include in your frontend code.pk_live_for productionpk_test_for test/sandbox environments
Provider Options (React)
The ReactFanfareProvider accepts additional configuration options:
autoRestore
Whentrue (default), the provider automatically restores any existing session from local storage when the component mounts.
autoResume
Whentrue (default), the provider automatically resumes active operations (queue polling, auction watching) after restoring a session.
loadingComponent
A React node to display while the SDK initializes:locale
Set the locale for built-in widget text:en, es, fr, de, it, pt, ja, ko, zh.
translations
Override or extend the default translations:Core SDK Configuration
These options can be passed toFanfareProvider (React) or directly to init():
environment
Set the API environment:| Environment | API URL | Use Case |
|---|---|---|
production | https://api.fanfare.io | Live traffic (default) |
staging | https://api-staging.fanfare.io | Pre-release testing |
development | http://localhost:4802 | Local development |
apiUrl
Override the API URL directly (takes precedence overenvironment):
debug
Enable debug logging to the console:- Initialization steps
- API requests and responses
- State changes
- Event emissions
auth
Configure authentication behavior:logging
Configure logging behavior:error.
sync
Configure multi-tab synchronization:- Session state is shared across tabs
- Queue positions update in all tabs
- Admission in one tab notifies other tabs
features
Enable or disable optional features:beacon
Configure analytics event tracking:Environment Variables
Store your credentials in environment variables for security:Framework-specific Environment Variables
| Framework | Prefix | Example |
|---|---|---|
| Next.js | NEXT_PUBLIC_ | NEXT_PUBLIC_FANFARE_ORG_ID |
| Vite | VITE_ | VITE_FANFARE_ORG_ID |
| Create React App | REACT_APP_ | REACT_APP_FANFARE_ORG_ID |
| Astro | PUBLIC_ | PUBLIC_FANFARE_ORG_ID |
Development vs Production
Use different credentials for development and production:Complete Configuration Example
Here is a fully configured provider with all options:Accessing the SDK Directly
Sometimes you need direct access to the SDK instance. Use theuseFanfare hook:
useFanfare hook returns the initialized FanfareSDK instance.
Next Steps
- First Experience - Create your first queue, draw, or auction
- Testing - Set up local testing with mock utilities
- Deployment - Production deployment checklist