> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# Method name:

duplexer.realtimePermissionsProvider.checkSubscriberPermissions(payload: CheckSubscriberPermissionsEnvelope)

# Method Link:

https://dev.wix.com/docs/sdk/core-modules/realtime/extensions/realtime-permissions-provider/check-subscriber-permissions.md

# Method Description:

Checks whether a subscriber has permission to receive messages on a Wix Realtime channel.

Wix calls this method when a subscriber from another app attempts a [cross-app subscription](https://dev.wix.com/docs/sdk/core-modules/realtime/realtime/introduction.md#cross-app-subscriptions) to one of your app's channels. The call is synchronous: Wix waits for your response before allowing or denying the subscription.

Wix uses the `read` value in your response to allow or deny the subscription. Return `{ read: true }` to allow the subscriber to receive messages on the specified channel or resource, or `{ read: false }` to deny.

Learn more about [the Realtime APIs](https://dev.wix.com/docs/sdk/core-modules/realtime/realtime/introduction.md).

*Error handling:** Use `{ read: false }` for normal policy denials. Don't throw an error to deny access. Return `InvalidArgumentError` only when the request contains invalid or missing data that prevents your service from processing it. For any other failure (thrown error, timeout, or unreachable service), Wix denies the subscription with a 503 HTTP status code.

# Method Permissions:



# Method Permissions Scopes IDs:

undefined



# Method Code Examples:

## Allow member subscriptions but deny visitors (Wix-managed)

```javascript
import { realtimePermissionsProvider } from '@wix/realtime/service-plugins';

realtimePermissionsProvider.provideHandlers({
  checkSubscriberPermissions: async (payload) => {
    const { request, metadata } = payload;

    // Allow members and admins, deny visitors.
    return { read: request.subscriber.type !== 'VISITOR' };
  },
});

```

## Allow member subscriptions but deny visitors (self-managed)

```javascript
import { createClient } from '@wix/sdk';
import { realtimePermissionsProvider } from '@wix/realtime/service-plugins';

const myWixClient = createClient({
  modules: { realtimePermissionsProvider },
  auth: {
    appId: '<YOUR_APP_ID>',
    publicKey: '<YOUR_PUBLIC_KEY>',
  },
});

myWixClient.realtimePermissionsProvider.provideHandlers({
  checkSubscriberPermissions: async (payload) => {
    const { request, metadata } = payload;

    // Allow members and admins, deny visitors.
    return { read: request.subscriber.type !== 'VISITOR' };
  },
});

// Route service plugin traffic to the SDK client.
app.post('/plugins-and-webhooks/*', (req, res) => {
  myWixClient.process(req, res);
});

```

