Core SDK Overview
The@waitify-io/fanfare-sdk-core package provides the foundation for integrating Fanfare experiences into your application. It is a framework-agnostic TypeScript library that handles all communication with the Fanfare API.
When to Use the Core SDK
The Core SDK is ideal when you need:- Full control over your UI and user experience
- Framework flexibility - works with React, Vue, Solid, Svelte, or vanilla JavaScript
- Server-side rendering compatibility
- Custom state management integration
- Minimal bundle size without UI components
@waitify-io/fanfare-sdk-react or @waitify-io/fanfare-sdk-solid) which provide pre-built hooks and components. These packages use the Core SDK internally.
Architecture
Key Concepts
FanfareSDK Instance
The SDK is initialized once and provides access to all modules:Modules
Each module encapsulates a specific domain:| Module | Description |
|---|---|
auth | Session management, guest/authenticated flows |
queues | Virtual waiting room with position tracking |
draws | Lottery-style random selection |
auctions | Real-time bidding experiences |
waitlists | Pre-launch notification signups |
timedReleases | Time-window based access |
experiences | Multi-stage journey orchestration |
beacon | Client-side event tracking |
Experience Journey
TheExperienceJourney class provides a state machine for orchestrating complex consumer journeys through multiple stages:
Event System
The SDK emits events for all significant state changes:Tab Synchronization
The SDK automatically synchronizes state across browser tabs, ensuring consumers maintain their position even when switching tabs:Installation
Basic Usage
TypeScript Support
The Core SDK is written in TypeScript and exports all types:Browser Support
The Core SDK supports all modern browsers:- Chrome 80+
- Firefox 75+
- Safari 13.1+
- Edge 80+
fetchPromiseBroadcastChannel(for tab sync)localStorage
Next Steps
- Initialization - Configure and initialize the SDK
- Client API - Full SDK instance reference
- Experiences - Journey orchestration
- Error Handling - Error types and handling patterns