Display Onboarding Flow

Your frontend should invoke the onboarding URL in a webview or a new tab.

const { url } = await getWattshiftOnboardingUrl();
const webview = document.createElement("webview");
webview.src = url;
document.body.appendChild(webview);

The user will be then be prompted to onboard onto WattShift and we will redirect to your redirect URL once the onboarding flow is complete.

Query Onboarding Status

You can query for the onboarding status with the following url

curl -X POST "https://api.wattshift.com/v1/onboarding/status/get"
     -D '{ "homeId": "home id" }'
      -H "x-ws-api-key: your api key"

Now you need to ensure you are responding to optimized schedules sent out by WattShift!