oDoc is an app that connects you with doctors for video, audio, and text consultations over your phone. It allows you to book over 350 SLMC registered GPs and specialists, obtain medical advice, receive a prescription (if medically required) and get your medication delivered. If lab tests are required, you could even order a mobile lab to your home or office. oDoc here gives you a javascript SDK in order to embed oDoc service inside your application.
react ^16.x
async-storage ^1.x
npm i odoc_patient_sdk_test
import * as React from 'react';
import ODOCSDK from 'odoc_patient_sdk_test'
import AsyncStorage from '@react-native-community/async-storage';
import { Constants } from 'odoc_patient_sdk_test/src/constants';
export interface Payload {
phoneNumber: string
firstName: string
lastName: string
appId: string
jsonData: string
authToken: string
mode: string
}
export default class App extends React.Component <Payload>{
constructor(props: any) {
super(props);
this.state = {
phoneNumber: "", /* Optional Prams*/
firstName: "", /* Optional Prams*/
lastName: "", /* Optional Prams*/
appId: "XXX",
jsonData: "", /* Optional Prams*/
authToken: "XXX", /* For signUp, you can pass an empty string to setAuthToken. Next time onwards, A valid auth token should be passed here. */
mode: Constants.development
}
AsyncStorage.getItem(Constants.authToken).then((token) => {
this.setState({
authToken: token || ""
})
})
}
callback(token: string) {
if(token != ""){
/* This token can be saved in any data source for next use. For example, AsyncStorage can be used here. */
AsyncStorage.setItem(Constants.authToken,token);
}
}
render() {
return (
<ODOCSDK callHome={this.callback.bind(this)} payload={this.state} />
);
}
}
phoneNumber:"7XXXXXXXX",
firstName:"Jone",
lastName:"Jude",
jsonData:"{}" //Set the custom json string used for branding, styling, etc..
oDoc uses appId in order to identify each app that uses oDoc service.
You can build a sample oDoc integration using this npm. You will have to
use the following appId in order to test how oDoc works with the oDoc development server .
appId: 1.0.0_test_1
If you would like to connect with oDoc Live server and connect & consult more than 350
SLMS registered doctors, You will have to contact oDoc Pvt Ltd, register your company/app
there & get your unique appId in order to build oDoc service in your app.
Constants.development - development
Constants.production - production
👤 oDoc (Private) Limited