This is the example of @saleor/app-sdk usage with a simple SPA based on Vite.js
Usage
With Saleor Platform
- Run Platform container
- Serve app
pnpm run dev
- Install the app via
http://host.docker.internal:5173/register.json
. This allows connecting from docker container to host machine.
With tunnel
- Access any Cloud Saleor instance.
- Serve app
pnpm run dev
- Run tunnel and map it to the vite port (5173 by default).
- Copy tunelled URL
- Edit
/public/manifest.json
and settokenTargetUrl
to be{{tunel address}}/register.json
andappUrl
to be{{tunnel address}}
- Install app with
{{tunnel address}}/manifest.json
Explainer
Since SPA do not have a backend layer:
- Manifest must be set statically or pre-built
- Registration workflow doesnt work (server side) -> json responds empty 200 with
{}
. App will not be able to save a token. Only frontend/client/dashboard logic will work - Reason of this POC is to check if app-sdk works with other stack than next.js