Homey Community Forum

[Custom pairing views] Advice on pairing wizard flow

I’m currently busy developing an app that uses a few custom views when pairing. In the views I created I’m using Vue and therefore I need some objects to mount to. But I also need the same information on the backend, so I’m wondering what’s the best approach to create the device and keep everything together over multiple steps.

The SDK shows an example where the device is created in the frontend: Custom pairing views - Homey Apps SDK.
But when I create the device in the frontend, I have to sync it (through the backend) to the next view.

Currently I see the following options:

  1. Create the device in the backend and sync it to the frontend on every view. All settings are directly written tot the device.
  2. Create the device in the frontend and somehow pass it through every view. I can also create a single-page view. Finally send the device to the backend where it is created and the pairing is finished.
  3. Make separate objects to keep track of the settings per view and create the device on the backend when finishing the pairing wizard.

When I create and maintain the object in the frontend, all logic should also be in the frontend.
Basically it comes down to this:
Should the frontend or the backend be in charge of keeping track of the data?
And where/when do I create the Homey-device?

Any advice on the prefered approach?