Installation
Install the SDK and React peer dependency:npm
yarn
pnpm
React 18 or higher is required for the React integration.
Setup
1. Wrap with Provider
Wrap your application withSnackBaseProvider:
2. Use Hooks
Use the provided hooks in your components:Provider Props
Environment-Specific Setup
Development
Production
With Next.js
App Router
Pages Router
With Vite
Access Client Directly
For advanced use cases, access the client directly:Server-Side Rendering
For SSR, skip provider on server:TypeScript Support
The React integration is fully typed:Complete Example
Next Steps
- useAuth Hook - Authentication hook
- useRecord Hook - Single record fetching
- useQuery Hook - Query building
- useMutation Hook - Mutations
- useSubscription Hook - Real-time subscriptions