Gets the Wix Blocks App data as a decoded Json Web Token (JWT) object.
The getDecodedAppInstance()
function returns a Promise that resolves to an object with data about the installation of your app on a specific site.
It is useful when managing your application's pricing.
function getDecodedAppInstance(): Promise<decodedAppInstance>;
import wixApplication from "wix-application";
// ...
let plan;
wixApplication
.getDecodedAppInstance()
.then((instance) => {
if (instance.vendorProductId) {
plan = instance.vendorProductId; // e.g. ‘basic’
}
console.log(plan);
})
.catch((error) => {
console.error("Error fetching the app instance:", error);
// Additional error handling logic
});
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.