Setup
Download the SDK
Integration:
The questionnaire web sdk can be integrated as a React component or using javascript methods exposed.
Integrating as React component
Obtain the ConsumerWebSDK object.
# using package manager
import { ConsumerWebSDK } from 'questionnaire-web-sdk'
# using CDN build
const ConsumerWebSDK = window.ConsumerWebSDK;
The components can be integrated as below.
<ConsumerWebSDK onExit={onExit} initData={data} apiKey={"your api key here"} />
Props
initData: ConsumerWebSDKData
This data is used to initialize the questionnaire web sdk. More details are available below.
onExit: () => void
This callback is called when there are no more questions. This can be used to do the cleanup. The component can be safely unmounted without loss of data.
apiKey: string
Obtain the API key required to connect with Askribe servers from the Settings section in your Askribe dashboard.