FanfareProvider
TheFanfareProvider component provides the Fanfare SDK instance to all child components in your SolidJS application.
Signature
Props
| Prop | Type | Required | Description |
|---|---|---|---|
sdk | FanfareSDK | Yes | Initialized SDK instance |
locale | Locale | No | Language locale |
translations | PartialTranslationMessages | No | Custom translation overrides |
children | JSX.Element | Yes | Child components |
Basic Usage
With Locale
With Custom Translations
useFanfare Hook
Access the SDK instance from any child component:Error Handling
TheuseFanfare hook throws if used outside the provider:
With Suspense
Multiple Providers
Nest providers for different configurations (not typically needed):Provider Internals
The provider sets up:- SDK Context - Makes SDK available via
useFanfare - I18n Context - Provides translations via
useTranslations
TypeScript
Related
- Overview - Solid SDK overview
- Components - Widget components
- Web Components - Web component registration
- Core SDK Initialization - SDK initialization