Quiz component
Components Visuals



To unlock early access to the component Get Access
Installation
To install the Quest react-native-sdk into your project, follow these steps:
Open your terminal/command prompt.
Navigate to your project's root directory using the
cdcommand if you're not already there.Run the following command to install the
quest-sdkpackage using npm:
This command will download and install the package and its dependencies into your project.
Make sure your project has npm and Node.js installed, and that you have the necessary permissions to install packages in your project directory.
Usage
Root Component
Import the QuestProvider Component: Import the
QuestProvidercomponent from the@questlabs/react-sdkpackage.
Pass the Required Props: Pass the required props to the
QuestProvider. The required props areapiKey,entityId,authenticationTokenandfontFamily.
To load external fonts, please refer this doc to setup expo-font on your expo app.
Component Usage
To integrate the useGamifiedQuiz component into your React native application, follow these steps.
Import useGamifiedQuiz Hook: Import the
useGamifiedQuizcomponent from the@questlabs/react-sdkpackage.Import the Gamified Component: Import the
Gamifiedcomponent from the@questlabs/react-sdkpackage.Pass the Required Props: Pass the required props to the
useGamifiedQuiz. The required props arequestId,questUserId, andquestTokenor if user don't have quest User id then they can pass own userId to get questUserId and Token.
Don't not use QuestProvider and useGamifiedQuiz Hook in same file
Props of Gamified Component
The Gamified component accepts the following props
actions
ICriteria[]
Require
in offline user need to provide the require filed data.
questId
string
Optional
Provied questId
questUserId
string
Optional
Provied the userId
userToken
string
Optional
Provied Quest Token
loading
boolean
Optional
don't use in offline mode.
onUpdateAction
(actionID: string, answer: (string | number)[])
Optional
Create your oen function for updateing the action.
header
string
Optional
Component header text
campaignVariationId
string
Optional
Id For verification.
onError
Function
Optional
For Showing the Error.
styleConfig
Object
Optional
An object containing Styling properties for styling various components within the get started process, including form, topbar, headings, descriptions, and buttons.
Style Props
Example Usage
App.js
DemoComponent.tsx
Demo
Last updated