Backend functions using appInstances.getAppInstance work fine when called from widget code, but fail with authentication error when called from settings panel code.
Error Message
json{
"message": "Missing authentication information",
"details": {
"applicationError": {
"description": "Missing authentication information",
"code": 400
}
}
}```
**Backend Code**
```js
import { appInstances } from "@wix/app-management";
import { auth } from "@wix/essentials";
import { Permissions, webMethod } from "@wix/web-methods";
export const getInstanceFunction = webMethod(Permissions.Anyone, async () => {
const elevatedGetInstance = auth.elevate(appInstances.getAppInstance);
try {
const instance = await elevatedGetInstance();
return instance;
} catch (error) {
console.error(error);
sendError(error?.stack || error?.message || error, "getInstanceFN", `N/A`);
throw error;
}
});
Calling From Widget Works Fine
Calling From Custom Panels Fail
What I Tried
Changed Permissions.Anyone to Permissions.Admin
Changed to Permissions.SiteOwner
Created separate function without webMethod
All produce same authentication error
Important Notes
Other backend functions (database/server calls) work fine from settings panel
Only functions using appInstances.getAppInstance fail in settings panel context
Widget code (even in editor preview) works perfectly