Add App Permissions in Blocks

When an app is installed on a Wix site, the app may need to access and manage some of the site's data. To enable this, the site builder must grant the required permission scopes to the app when installing it. The app permissions are specific to the APIs that you use in your app.

Code that requires permissions

Adding permissions is necessary in the following cases:

  • If you added dependencies to Wix apps: If you added dependencies to Wix's business-solutions apps (such as Stores or Bookings), you are probably using their APIs. You must add permissions, or else these APIs will cause your code to fail.
  • If you need to access site data: If your app needs to access data from sites it's installed on, you'll need permissions to use the specific APIs required for this data.
  • If you used other APIs: Even if you didn't add permissions and don't need to access site data, there are other Velo APIs that require permissions.

Code that doesn't require permissions

You do not need permissions in the following cases:

  • For your app's internal business logic.
  • For your custom panel code, including the wix-widget and wix-editor modules.
  • To use wix-dashboard module.

If you didn't add the required permissions

If your app requires permissions, but you didn't add them and so a site builder didn't provide consent, your code won't work. Everything might seem OK in Blocks - the release process won't fail. But once the app is installed on a site, the site will get a 403 screen instead of the app and the console will say that an API failed.

So you should be extremely cautions about permissions, especially if your app is already installed on users' sites. First, test your app on your own site, to see that your app works. Then release a major version for user sites.

Finding the required permissions

Follow these steps to make sure you don't miss the required permissions. Each step is only needed if the first one wasn't successful.

Step 1 | Search the Velo reference

In most cases, if an API requires permissions, you will see it in the Velo reference, under the Permissions section.

For example, the bulkCreateBooking() function requires the following permissions:

  • MANAGE BOOKINGS
  • MANAGE BOOKINGS - ALL PERMISSIONS

You can click the permission to add it to your app.

Permissions scope

Step 2 | Search the legacy APIs

If you don't see permissions specified for your function in the API reference, take a look in the Velo legacy APIs permissions list.

Step 3 | No permissions needed

If the API you are using has no permissions specified in the reference and it doesn't appear in the legacy list, you can assume that no permissions are needed.

Ways to add permissions

You can add permissions in several ways:

  • In Blocks, click WixBlocks > App > App Permissions. This takes you to your app dashboard Permissions section.
  • Go directly to your app Permissions section in the app dashboard.
  • Click a specific permission from the Velo API reference and then select your app.

See also

Did this help?