SmartFlex Onboarding V2
In order to onboard a customer to SmartFlex, they must be directed to register a device with Kraken and, if relevant, switch to an appropriate tariff.
📣 Note: SmartFlex Onboarding does not handle tariff switching. If you want the customer to be on a specific tariff, you will need to handle this separately.
Onboarding Wizard​
To onboard a device, the user must progress through the onboarding wizard by fetching
and completing the current onboarding step until the current step returns null
, signifying a successful onboarding.
Start onboarding wizard​
To begin a new onboarding journey, you can use the following mutation:
Cancel onboarding wizard​
If you want to cancel an onboarding journey, you can use the following mutation:
📣 Note: cancelling an onboarding wizard will not delete a device that has already been registered. If you want to delete a device, you will need to use the DeauthenticateDevice
mutation.
If you don't want to cancel an onboarding wizard, you can also reverse the onboarding step by calling the mutation for that step with a new selection. This will set the new option as the selected option and reset the current step to that step. Note: not all steps are reversible, so this won't work for all steps.
Fetch onboarding wizard(s)​
This is useful for:
- Polling the current step, e.g. in the case of waiting for
DeviceRegistration
orWaitForTransition
to complete. - Returning a user to an onboarding wizard if they leave it.
Onboarding Step​
The step order is dynamic, so when fetching the current step the query must be ready to accept any step type.
A few important points:
- The
currentStep
field in thesmartflexOnboardingWizards
query will return the current step of the onboarding journey. - If you want to go back to the previous step (reversing a step) and select a different option, you should call the mutation for that step with the new selection. This will set the new option as the selected option and reset the current step to that step. For example, if you have already selected a vehicle make and you are now at the
SelectVehicleVariant
step, but you want to change the vehicle make, you should call theselectVehicleMakeForSmartFlexOnboarding
mutation with the new make. This will reset the current step to theSelectVehicleMake
step and set the given option as the selected make. You will now get a new instance of theSelectVehicleVariant
step with the variants filtered to only those that match the selected make. - Not all onboarding steps are reversible. For example, device registration step is not reversible.
An example of how this could look is as follows (note: this example does not include all possible step types):
Most steps have their own mutation that must be called in order to complete the step and enable the user to move to the next step.
SelectDeviceType​
WaitForTransition​
If the WaitForTransition
step is returned as the current step we should consider the Kraken onboarding journey to be paused because we're waiting on an external action to be completed.
Examples of such external actions are:
- Action needs to be taken by a third party, like the device manufacturer manually approving the device for registration in their platform.
- Action needs to be taken by a customer in a third party app, like enabling location permissions in a manufacturer's mobile application.
Kraken will check if the external action has been completed when querying for the current step on a wizard. Requesting the currentStep
field in the smartflexOnboardingWizards
query can be used to check if the external event (and therefore the step) has been completed, and the onboarding journey can continue.