admin-extension-sdk
admin-extension-sdk copied to clipboard
Directly call app backend
Right now it is only possible to call the app backend via action buttons. Is it possible to call the app backend in a secure way as it is for the client side (https://github.com/shopware/shopware/discussions/3191)?
Sorry that this went unnoticed for quiet some time. We'll check this ASAP and get back to you.
Hey @bilobait-lohrmann :)
I have a solution for you for this problem. If this fullfills your needs I would also write a documentation for this in the SDK. How it is working:
Your server delivers the html file for the iFrame. Every rendered iFrame has added the shop-id as a query parameter. You can get the token for this shop the same way as in the action buttons. Then you add your token inline into the HTML file as a global window variable and this token can then be used directly inside your JS code. A real life example can be found here: https://github.com/FriendsOfShopware/FroshAppWebDav/blob/main/src/handler.ts#L66
If this approach works for you then let me know and I would write a more detailed documentation for this 👍
Hi @jleifeld
sounds great. thank in advance for the documentation