Initializing the Web SDK
1. Adding the HTML element to your DOM
Include an <ezyhire-render>
tag in your HTML and assign it a unique ID to render a specific component from ezyhire.
The ID assigned to this element will be utilized in the renderEzyhire
method.
Here’s an example:
<ezyhire-render id="example-div"></ezyhire-render>
2. The renderEzyhire
method
The renderEzyhire
method will display the specified component from ezyhire onto the DOM element you’ve designated in the configuration.
The method requires two arguments:
- The DOM element ID.
- The ezyhire configuration.
$ezyhire.renderEzyhire('example-div', ezyhireConfig)
3. The ezyhireConfig
The ezyhireConfig includes the following configurations:
- component (required) - Specify the component you want to render.
- apiKey (required) - Supply the API Key obtained from ezyhire.
- reportCallbackUrl (required if component is
reportList
) - The URL of your application where you rendered the test report component. - callbacks (optional) - Utilize a list of callbacks provided by the ezyhire SDK to execute actions on various methods.
List of components available in SDK
You can pass one of this component to render in your app:
Component | What it will render |
---|---|
testList | List of ezyhire library and your custom tests. You can send test to candidate or start ezyRecruit |
reportList | List of tests sent by you to your candidates. You can view/download report of completed tests. |
questionsList | List of ezyhire library and your custom questions. |
createTest | Create test form using which you can create your custom test. |
createQuestion | Create question form using which you can create your custom question. |
report | Detailed report of the completed test |
List of callbacks available
You can use the callbacks based on your use case
Callback | When it will execute |
---|---|
sendTestCallback | When test is successfully sent to candidate |
startRecruitProCallback | When recruit pro is successfully started |
viewReportCallback | When test report is viewed by the user |
dowloadReportCallback | When test report is downloaded by the user |
viewQuestionCallback | When question is viewed by the user |
addTemplateCallback | When custom test is successfully added by user |
addQuestionCallback | When custom question is successfully added by user |