Supported Platforms
The SDK supports five platforms via theplatform configuration option:
Backend Platforms
Backend platforms support private API key authentication and are intended for server-side environments.Node.js
Node.js is the default platform if not specified.
- APIs and web services
- Backend services
- Server-side workers
- Microservices
- Supports private API keys
- API keys should be stored as environment variables
- Never expose API keys in client-side code
Bun
Typical use cases:- High-performance backend services
- Local development servers
- Server-side applications requiring fast startup times
- Supports private API keys
- Environment variables are automatically loaded from
.envfiles
Deno
Typical use cases:- Serverless functions
- Edge-like services
- Secure server-side applications
- Supports private API keys
- Access environment variables via
Deno.env.get()
Frontend Platforms
Frontend platforms use JWT authentication and are designed for client-side environments where private API keys cannot be safely stored.Browser
Characteristics:- No access to private API keys
- Authentication performed via JWT
- Requests include
credentials: 'include'to support httpOnly cookies tokenStorageis optional (recommended to use httpOnly cookies)
Example: httpOnly Cookie Storage
React Native
Characteristics:- No access to private API keys
- Authentication performed via JWT
tokenStorageis required to provide/store the JWT token- Should use platform-specific secure storage
AsyncStorage
@react-native-async-storage/async-storage for simple persistenceSecure Store
expo-secure-store or platform-specific Keychain/Keystore for sensitive dataExample: AsyncStorage
Example: Expo Secure Store
Platform Detection
If you don’t specify aplatform, the SDK defaults to 'node'. For cross-platform libraries, you can detect the platform programmatically:
Auto-detect Platform
Platform Compatibility
The SDK validates platform and authentication compatibility at runtime:Backend platforms (node, bun, deno)
Backend platforms (node, bun, deno)
- Can use
apiKeyorjwtauthentication - API key authentication is recommended
tokenStorageis optional for JWT auth
Browser platform
Browser platform
- Must use
jwtauthentication - Cannot use API key authentication
tokenStorageis optional (uses httpOnly cookies by default)
React Native platform
React Native platform
- Must use
jwtauthentication - Cannot use API key authentication
tokenStorageis required
Next Steps
Configuration
Learn about all SDK configuration options
Error Handling
Handle platform-specific errors