Prerequisites
Before installing the SDK, ensure you have:- Node.js 18+ or a compatible runtime
- npm, yarn, or pnpm for package management
- A SnackBase instance (local or hosted)
Installation
npm
npm
yarn
yarn
pnpm
pnpm
React Integration
If you’re using React, you’ll also need React installed as a peer dependency:npm
The React integration is exported from the same package (
@snackbase/sdk/react)
and requires React 18 or higher.Platform Support
The SDK works across multiple JavaScript environments:| Platform | Support Level | Notes |
|---|---|---|
| Modern Browsers | Full | Chrome, Firefox, Safari, Edge |
| React Native | Full | Uses AsyncStorage for tokens |
| Node.js 18+ | Full | Server-side rendering, APIs |
| Next.js | Full | Both App and Pages routers |
| Vue/Nuxt | Full | Via the core SDK |
| Svelte/SvelteKit | Full | Via the core SDK |
TypeScript Support
The SDK is written in TypeScript and includes full type definitions. No additional@types packages are needed.
Bundle Size
The SDK is optimized for production use:- Core SDK: 14.87 KB (gzipped)
- React Integration: 1.42 KB (gzipped)
- Total: 16.29 KB (gzipped)
Verification
After installation, verify the SDK is working:Next Steps
- Quick Start Guide - Get started with your first query
- Configuration - Explore all configuration options
- Authentication - Learn about authentication methods