The Site API lets you control subscriber permissions for the Realtime APIs. It determines which subscribers can receive messages on specific channels and resources.
With the Site API, you can:
realtime_check_permission hook.Important:
You can only use the Site API when developing websites. When building apps, subscribers receive the default { read: true } permissions.
To provide custom permission checks for channels your app manages, implement the Realtime Permissions service plugin.
Learn more about cross-app subscriptions.
It's important to note the following points before starting to code:
realtime-permissions.js file in a site's backend, even if realtime_check_permission isn't defined. Without the file, subscriptions fail.realtime_check_permission hook isn't defined, all subscribers receive the default permissions of {"read": true}.read permissions are always true.Restrict a channel so only the Wix user can receive messages. Use the permissions router to add a handler that checks subscriber.type: