Realtime Permissions Provider: Sample Flows

This article presents a possible use case and corresponding sample flow that you can support. It provides a useful starting point as you plan your implementation.

Check permissions for a cross-app subscription

When a subscriber from another app attempts to subscribe to a channel managed by your app, Wix calls your Realtime Permissions service plugin to determine whether the subscriber can receive messages on that channel.

Note: Your app must have a Realtime Permissions Provider extension with a deployment URI.

A cross-app subscription includes the following steps:

  1. A site visitor or member on another app's site calls Subscribe with your app's appId, requesting to subscribe to one of your app's channels or resources.

  2. Wix calls Check Subscriber Permissions with details of the requested subscription, along with request metadata:

    Copy
  3. Your service plugin applies your permissions logic. For example, the following implementation allows members and admins to subscribe to the premium-updates channel but denies visitors:

    Copy

    Learn more about service plugin extensions.

    Your implementation must return an object with a read boolean. Return true to allow the subscription, or false to deny it:

    Copy
  4. Wix applies the read value from your response. If read is true, the subscriber starts receiving messages on the channel. If read is false, Wix denies the subscription and the subscriber doesn't receive messages.

    Note: If your handler throws an error, times out, or is unreachable, Wix denies the subscription with a 503 HTTP status code.

Did this help?