Ignition 8.3: Guidance/example on end-to-end WebUI / Gateway interaction

I’ve been able to update my company’s module to function correctly under Ignition 8.3 except for the configuration UI. In other words, I’m successfully migrating the configuration from the old SQLite record stuff to the new JSON-based resource stuff. And I can edit those JSON files as a “brute force” method of configuring my module. But this obviously isn’t good enough for our customers.

I have the ignition-sdk-examples/webui-webpage at ignition-8.3 · inductiveautomation/ignition-sdk-examples · GitHub example integrated into my module.

The missing piece is that I don’t see any example (or even mention) of how to facilitate communication between the web ui and the gateway. In my case, the need is very simple: Read and write a relatively small JSON blob of configuration from the web UI.

Do I need to expose a new API from the Gateway somehow?

Yes. That example includes custom APIs for the example.

For parts that write back, see the discussion of the CSRF token in this topic:

I must be blind… I don’t see any Java code in the webui example that looks like an API, nor do I see any Typescript code that does a fetch.

The only thing I see that is somewhat related to a backend API is this placeholder:

Hmmm. You're right. The gateway hook's .mountRouteHandlers() method is empty.

That's where you need to register your APIs and connect their implementations.

This was where I got the inspiration for my drivers:

(I didn't register them in the OpenAPI docs.)

This is a working config settings example that I wrote, it’s not perfect but it’s fully functional with the API written inside.