BoxpressdProvider is the foundation of every Boxpressd Sites SDK application.
It establishes authentication, resolves the business context associated with your API key, provides theme configuration, and enables all Boxpressd components and data APIs throughout your application.
Every application using the SDK should wrap its component tree with a single provider instance.
Basic Usage
At minimum, provide your Boxpressd API key:- Authenticate with Boxpressd
- Resolve the business context
- Determine the business type
- Configure data access
- Enable SDK components and hooks
Environment Variables
Store your API key in an environment variable rather than hardcoding it in your application.How Business Context Resolution Works
When the provider initializes, the SDK automatically determines which business should be loaded. For example:- Venue IDs
- Brand IDs
- Business IDs
- Custom API endpoints
Provider Placement
The provider should typically be mounted once near the root of your application.Next.js App Router
React
Custom API Endpoint
By default, the SDK connects to the production Boxpressd API.Theme Configuration
The provider supports global theme customization.Theme Example
CSS Variable Overrides
In addition to provider-level theme options, all Boxpressd components expose CSS variables prefixed with:Using SDK Components
Once the provider is configured, all Boxpressd components can access the resolved business context automatically.Best Practices
Use a Single Provider
Most websites should only use one provider instance.Store Keys in Environment Variables
Avoid hardcoding API keys directly into source code.Configure Theme Globally
Apply theme settings at the provider level instead of styling individual components whenever possible.Troubleshooting
Components Show No Data
Verify:- The API key is valid
- The provider is mounted correctly
- The business contains published content
- The environment variable is available at runtime
Authentication Errors
Verify:- The API key has not been revoked
- The API key belongs to the expected business
- The correct environment variable is being used
Theme Changes Not Appearing
Verify:- The provider is wrapping the component tree
- CSS variable overrides are loaded after SDK styles
- Theme values are valid CSS values
Next Steps
Now that the provider is configured, continue to:- Business Context
- Business Types
- Theming
- Components Overview