Search.../

getDecodedAppInstance( )

Gets the Wix Blocks App data as a decoded Json Web Token (JWT) object.

Description

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.

Syntax

function getDecodedAppInstance(): Promise<decodedAppInstance>

getDecodedAppInstance Parameters

This function does not take any parameters.

Returns

Fulfilled - An object with data about the installation of your app on a specific site.

Return Type:

Promise<decodedAppInstance>
NAME
TYPE
DESCRIPTION
appDefId
string

The unique idenfitier of your app.

instanceId
string

The ID of your app on this specific site.

vendorProductId
string

The Plan ID of the app purchased by the site. NULL if there is no plan.

Was this helpful?

Retrieve the Vendor Product ID

Copy Code
1import wixApplication from 'wix-application';
2
3// ...
4
5wixApplication.getDecodedAppInstance()
6 .then((instance) => {
7 const plan = instance.vendorProductId; // 'basic'
8 })
9 .catch((error) => {
10 console.error(error);
11 // Handle the error
12 });