App Management: Sample Use Cases and Flows

This article shares some possible use cases your app 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 app's implementation.

Reach out to new users

You could reach out to your app's new users. For example, you could encourage free users to upgrade their version.

To reach out to new users:

  1. Listen to the Instance App Installed webhook. Make sure to save the data.instanceId from the payload.
  2. Pass the instanceID when calling Get App Instance.
  3. Optional: In the response data, confirm that the site owner's have installed the free version of your app by checking instance.isFree. You may use this information to encourage them to upgrade.
  4. Save the site owner's email, you can find it in instance.ownerInfo.email. Make sure to confirm that the user has opted in to receive communication by checking that instance.ownerInfo.emailStatus is either "VERIFIED_OPT_IN" or "NOT_VERIFIED_OPT_IN". Note that you must have added the Read Site Owner Email permission scope to your app during the setup process in the Wix Developers Center. In case you, haven't requested this permission, the ownerInfo object is always returned empty.
  5. Optional: In case the owner's have opted in to receive notifications, send them an email that includes a link to the Upgrade Button. Then, you could listen to the Paid Plan Purchased webhook to get notified about the upgrade.

We recommend signing up for the Instance App Installed webhook. In case your app is using Wix REST APIs, you would also receive an access token that includes the app instance ID during the OAuth setup, but listening to the webhook ensures the installation process has succeeded.

Identify a site's installed Wix business solutions

In case your app requires that the site owners have also installed a specific Wix business solution, you can verify that the relevant app is installed on that site. During your app's setup process in the Developers Center you can mark one or more Wix app's as requirements, but we recommend to follow this flow since you may support different use cases, depending on which Wix app is installed. For example, your app may support different use cases, depending on whether the site includes Wix Stores or Wix Bookings.

To Identify a site's installed Wix apps:

  1. Listen to the Instance App Installed webhook. Make sure to save the data.instanceId from the payload.
  2. Pass the instanceID when calling Get App Instance to retrieve installed Wix apps. You can find them as human-readable names in the site.installedWixApps array. In case your app supports multiple use cases, check if you can identify the user's intent from the list of returned apps alone.
  3. If you can't identify the desired use case because the site owners have installed multiple Wix apps for which you support different flows, present a modal to them that lets them choose their preference.

Automatically log users in to your app

You could automatically create a user login for new customers of your app. Then, site owners don't need to set up an account for your app on their own. They could also share their account for your app with multiple contributors without being forced to share sensitive login info.

To create user logins:

  1. Listen to the Instance App Installed webhook. Make sure to save the data.instanceId from the payload.
  2. Pass the instanceID when calling Get App Instance to retrieve the site owner's email, you can find it in instance.ownerInfo.email. Note that you must have added the Read Site Owner Email permission scope to your app during the setup process in the Wix Developers Center. In case you, haven't requested this permission, the ownerInfo object is always returned empty.
  3. Set up the automatic user login on your app's side.
Was this helpful?
Yes
No