App Management: Sample Use Cases and Flows

This article shares some possible use cases you could support, as well as a sample flow that could support each use case. This can be a helpful jumping off point as you plan your implementation.

Reach out to new users

When a Wix user installs your app, you can collect their email address and send them a welcome email.

To retrieve new users' email:

  1. Ensure your app requests the Read Site Owner Email permission scope.
  2. Listen to App Instance Installed to be notified when a new user installs your app. Save the data.instanceId value from the payload.
  3. Call Get App Instance with the instanceId collected above. This returns an object containing data about a specific app instance. Inside the object, you'll find the site owner's email in site.ownerInfo.email.
  4. Send your email.

Notes:

  • If the ownerInfo object returns empty, check to make sure you've added the correct permission scope to your app.
  • You'll need to check on your end whether the user has opted in to communications from your app.

Identify a site's installed apps made by Wix

Your app may be dependant on a specific app made by Wix. In this case, you can use the App Management API to verify that the relevant app is installed on a site. If so, Wix recommends marking one or more apps made by Wix as requirements. This will block the installation of your app and prompt the Wix user to install the required app.

However, if your app supports different use cases depending on which app is installed, we recommend following the steps below. For example, your app may offer one flow for a site that includes Wix Stores, and a different flow for a site that includes Wix Bookings.

To identify a site's installed apps made by Wix:

  1. Listen to App Instance Installed to be notified when a Wix user installs your app. Save the data.instanceId value from the payload.
  2. Call Get App Instance to retrieve a list of the site's installed apps made by Wix. You can find this list in the site.installedWixApps array.

With this data, your app can now perform any logic on your end to adjust your app's flows to the installed Wix apps. If the user has installed multiple apps made by Wix for which you support different flows, you can present them with a modal that lets them choose their preference.

You can call Get App Instance regularly to stay up to date on a site's installed apps. If a Wix user no longer has a required Wix app installed, you may want to adjust your flow, or ask them to reinstall it. This is important to prevent getting errors when calling APIs that rely on an app made by Wix being installed.

Did this help?