The ability to debug is important for app developers. App SDK provides opt-in verbose logs, that can be enabled for specific modules.
Debug logs are implemented with debug package and work both in Node and Browser.
Debug logs are aggregated within namespaces. They can be enabled, disabled, or configured.
By default, all verbose logs are disabled.
To enable logs, use the following:
Add DEBUG=app-sdk:{namespaces}
env variable.
DEBUG=* pnpm run dev
For more details check debug package.
Set localStorage.debug = 'app-sdk:{namepsaces}'
in your frontend code. For more details see debug package.
Note, that Saleor Apps are usually hosted on a different domain than Saleor Dashboard.
That means localStorage
must be called in the context of the App's URL, not Saleor Dashboard.
// In devtools console
localStorage.debug = "*";
Use the namespace name to enable debug logs for each module.
Namespace name | Description |
---|---|
\app-sdk:* | Enable all |
app-sdk:AppBridge | Enable AppBridge (browser only) |
app-sdk:Middleware:* | Enable all middlewares (node only) |
app-sdk:APL:* | Enable all APLs (node only) |
app-sdk:SaleorAsyncWebhook:* | Enable SaleorAsyncWebhook utility |