getDecodedAppInstance( )


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.

Method Declaration
Copy
function getDecodedAppInstance(): Promise<decodedAppInstance>;
Request
This method does not take any parameters
Returns
Return Type:Promise<decodedAppInstance>
Retrieve the Vendor Product ID
JavaScript
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 });
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?