I have an embedded app that allows a user to create a table. Within the table a merchant can manipulate the columns and row values (very basic yet flexible).
I was wondering if it was possible to allow the merchant to click a button within the app which would trigger the table publishing to the merchants website?
If possible, which API would I use? Graph? Storefront? Other?
Would the merchant need to customize their theme?
Thanks in advance.
Solved! Go to the solution
This is an accepted solution.
That would be possible. I assume you already have the HTML and CSS you need on your end, so you could take that and publish it via the admin assets REST API and/or the admin script tags REST API.
There's an Admin GraphQL API alternative for script tags:
The rest is just deciding when and where to render/publish that table using these tools. There's probably more than just these approaches, but those are what immediately came to mind.
As you iterate script_tags may be fast but if your just rendering html consider letting merchants add a liquid include to their templates where they want the table to appear and use the assets api to add a snippet, or pages api to use page techniques.