Skip to main content

Overview

Welcome to the React Web SDK for Altibbi services, your comprehensive solution for integrating health consultation services into your React web applications. This SDK enables video and text consultations, real-time notifications, and many other features to provide a seamless healthcare experience in the browser.

react-web-altibbi is the web port of react-native-altibbi — same functionality, same public API, running in the browser instead of on a native mobile runtime.

LayerReact Native SDKReact Web SDK
REST APIfetch + React Native FormDatafetch + browser File/Blob
Constants / Initinit()Identical
Types & static dataIdenticalIdentical
Realtime socketNative Pusher bridgepusher-js (same TBISocket API)
Video / VOIPNative OpenTok@opentok/client (same TBISession/TBIPublisher/TBISubscriber/TBISubscriberView components)
Chat@sendbird/chat@sendbird/chat (platform-agnostic, unchanged)

Features

  • Video and VOIP Consultation: Facilitate live video and VOIP sessions between patients and healthcare professionals using OpenTok.js.
  • GSM Consultation: Facilitate GSM (phone calls) sessions between patients and healthcare professionals.
  • Text Consultation: Offer real-time text messaging for healthcare inquiries.
  • User Management: Easily manage user information with our comprehensive API.
  • Media Management: Upload and manage media files (images, PDFs) attached to consultations.
  • AI Models: Leverage machine learning for specialty prediction, consultation summaries, SOAP notes, and transcriptions.
  • Sina AI Chat: Integrate the Sina AI assistant for intelligent health-related conversations.
  • Real-time Notifications: Keep users updated with realtime socket events and server-to-server callbacks.

Below is an illustration of the SDK development journey:

SDK Architecture

Differences from react-native-altibbi

Since the SDK runs in a browser rather than on a native device, a few APIs differ in shape:

  • uploadMedia(file, type, fileName) and uploadSinaMedia(file, type, fileName) take a File/Blob (e.g. from an <input type="file"> element) instead of a native file path string.
  • getPrescription(consultation_id) returns the raw fetch Response object. On web you read it with await response.blob() and turn it into a downloadable URL with URL.createObjectURL(blob).
  • Realtime and video functionality are backed by pusher-js and OpenTok.js under the hood, but the component and function names (TBISocket, TBISession, TBIPublisher, TBISubscriber, TBISubscriberView) are unchanged, so code ported from the React Native app needs minimal changes.

Peer Dependencies

react-web-altibbi relies on the following packages, which must be installed alongside it:

  • react / react-dom (^18)
  • @opentok/client — video/VOIP calling
  • @sendbird/chat — chat consultations
  • pusher-js — realtime socket events
  • react-router-dom, uuid — used internally by the SDK

See the Installation guide for exact steps.