Installation
Download SDK Source
Download SDK (.zip)Prerequisites
- React 18 or higher
- Node.js 16 or higher
Installation
Install the SDK with npm:
npm install react-web-altibbi
Or with yarn:
yarn add react-web-altibbi
Peer Dependencies
The SDK depends on the following packages for video, chat, and realtime features. Install them alongside the SDK:
npm install @opentok/client @sendbird/chat pusher-js react-router-dom uuid
CORS / Same-Origin Setup
Unlike a native app, browser requests are subject to CORS. Your baseURL (and sinaModelEndPoint, if you use Sina AI) must either:
- Be served from the same origin as your web app, or
- Be CORS-enabled to accept requests from your app's origin, or
- Be proxied through your own backend/reverse-proxy (recommended for production).
During local development you can proxy requests through your dev server. For example, with Vite:
// vite.config.ts
export default defineConfig({
server: {
proxy: {
'/altibbi': {
target: 'https://your-partner-endpoint.com',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/altibbi/, ''),
},
'/sina': {
target: 'https://your-sina-endpoint.com',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/sina/, ''),
headers: {
'partner-host': 'https://your-partner-endpoint.com',
},
},
},
},
});
Then pass /altibbi and /sina as the baseURL/sinaModelEndPoint values to init.