Option 1: React / React Native SDK (Recommended)
If your application uses React or React Native, the SDK is the recommended integration path. It wraps the REST API in a set of hooks and context providers that do the heavy lifting:- Token lifecycle — Access tokens are requested, stored, and refreshed automatically. You never manually manage auth headers.
- Real-time — The chat system connects via WebSocket automatically when
ChatProvideris mounted. Message delivery, read state, and typing indicators are handled for you. - Optimistic state — Actions like sending a message or toggling a reaction update local state immediately and sync with the server in the background.
- Typed interfaces — Every object your hooks return is typed against the interfaces in
@replyke/core. You get full autocomplete and type safety across entities, users, conversations, comments, and more. - Context providers — Features like the entity subtree, comment section, conversation, and space are scoped via React context providers, so any component in the subtree can access the full feature state with a single hook call.
React (Web)
Install
@replyke/react-js. Works with Next.js, Vite, Create React App, or any React web setup.React Native / Expo
Install
@replyke/react-native (or @replyke/expo for Expo-managed workflows with secure token storage).SDK Package Reference
| Package | Platform | Notes |
|---|---|---|
@replyke/react-js | React web | Full SDK for browser environments |
@replyke/react-native | React Native | Full SDK with AsyncStorage token storage |
@replyke/expo | Expo | Same as React Native but uses SecureStore |
@replyke/core | Shared | Platform-agnostic hooks and types — not imported directly in most cases |
Option 2: Raw REST API
If your application does not use React, or you need to call Replyke from a server-side context, the REST API is available directly. All endpoints are under/:projectId/api/v7/. Every request that requires a user identity must include a valid access token in the Authorization: Bearer <token> header.
Use cases for direct API access:
- Vue, Angular, Svelte, or other non-React frameworks
- Server-to-server operations (e.g., creating entities on behalf of users, webhook handlers, scheduled jobs)
- Custom SDKs or thin client wrappers
- Testing or exploration with tools like Postman or curl
Service API Key (Recommended for Server-to-Server)
For server-to-server calls, using a service API key is almost always the right approach rather than managing individual user access tokens. A service API key is generated once from the project dashboard and stored securely on your server. When included in a request, it grants elevated access to the API:- No user token required — the service key bypasses user authentication entirely. You do not need to sign in as a user or manage token refresh on the server.
- Act on behalf of any user — many endpoints accept a
userIdbody parameter when the request is authenticated with a service key, allowing you to perform actions on behalf of a specific user. - Elevated permissions — the service key bypasses ownership checks, so it can update or delete any content, access draft entities, and read private user fields regardless of which user owns the resource.
When using the API from a client-side (browser/mobile) context without a service key, you are responsible for requesting and refreshing user access tokens, maintaining auth state, and handling real-time features (WebSockets) yourself if needed.
Option 3: Redux Store Integration
If your React application already has its own Redux store, you can integrate Replyke’s state directly into it rather than using the default built-in store. By default,ReplykeProvider creates an internal Redux store for Replyke’s state. If you have an existing store, using two separate Redux stores in one app is not ideal. ReplykeIntegrationProvider lets you pass your own Redux store configuration and mount Replyke’s reducers and middleware alongside your own.
This requires:
- Adding
replykeReducersandreplykeApiReducerto yourcombineReducerscall - Adding
replykeMiddlewareto your middleware chain - Using
ReplykeIntegrationProviderinstead ofReplykeProvider
Choosing the Right Path
| Scenario | Recommended |
|---|---|
| Building with React or React Native | SDK (@replyke/react-js or @replyke/react-native) |
| Expo project | @replyke/expo |
| Already have a Redux store in React | SDK + Redux integration (ReplykeIntegrationProvider) |
| Vue, Angular, Svelte, or other frameworks | REST API with user access tokens |
| Server-side / backend operations | REST API with service API key |
| Webhook handlers, scheduled jobs, data pipelines | REST API with service API key |
| Mobile app without React Native | REST API with user access tokens |

