Add the consultation experience
The consultation provider gives the SDK the user token and integration configuration. Place it around only the part of the application that needs to render Abi consultation flows.
Provide the consultation context
Section titled “Provide the consultation context”import { ConsultationsProvider } from '@abihealth/goapp-react-native'
export function ConsultationArea({ userAccessToken }) { return ( <ConsultationsProvider region={region} token={userAccessToken} theme={theme} components={components} onError={handleSdkError} disableSslPinning={false} > {/* Screens that use the Abi SDK */} </ConsultationsProvider> )}| Property | Purpose |
|---|---|
region |
The Abi region agreed for the partner launch. |
token |
The short-lived user token obtained by your backend. |
theme |
Optional colors, typography, spacing, borders, and shadows. |
components |
Optional partner components for supported SDK screens. |
onError |
Error callback for integration monitoring and recovery. |
disableSslPinning |
Leave disabled. Change it only under Abi’s written technical guidance. |
Render a video consultation
Section titled “Render a video consultation”import { VideoConsultation } from '@abihealth/goapp-react-native'
;<VideoConsultation options={options} eventHandlers={eventHandlers} />Use options for enabled experience-specific inputs, such as a delivery address in prescription flows. Address fields and validation vary by country and pharmacy integration; confirm their shape for each launch.
Handle lifecycle events
Section titled “Handle lifecycle events”The SDK exposes events so the host application can update its own navigation, notifications, and analytics-free operational state.
const eventHandlers = { onSubmitted: (consultation) => updateConsultation(consultation), onClaimed: (consultation) => updateConsultation(consultation), onVideoCallStarted: (consultation) => updateConsultation(consultation), onVideoCallEnded: (consultation) => updateConsultation(consultation), onDeliveryAddressSubmitted: (consultation) => updateConsultation(consultation), onPrescriptionSubmitted: (consultation) => updateConsultation(consultation), onSummaryGenerated: (consultation) => updateConsultation(consultation), onResolved: (consultation) => updateConsultation(consultation), onClosed: (consultation) => updateConsultation(consultation), onCancelled: (consultation) => updateConsultation(consultation), onConsultationEnded: () => closeConsultationJourney()}You can also access the current consultation and supported actions from the consultation hook:
const { consultation, start, cancel } = useConsultation()Consultation fields and lifecycle states are documented in the REST API reference rather than duplicated here.
Next step
Section titled “Next step”Review the SDK architecture and connect your backend to the authentication guide.
