@wix/realtime 1.0.52 → 1.0.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3849,7 +3849,7 @@
|
|
|
3849
3849
|
{
|
|
3850
3850
|
"type": "GUIDE",
|
|
3851
3851
|
"title": "Introduction",
|
|
3852
|
-
"src": "---\narticleType: intro\n---\n\n# About the Site API\n\nThe Site API lets you control subscriber permissions for the [Realtime APIs](https://dev.wix.com/docs/sdk/core-modules/realtime/realtime/introduction). It determines which [subscribers](https://dev.wix.com/docs/sdk/core-modules/realtime/realtime/subscriber/introduction) can receive messages on specific [channels and resources](https://dev.wix.com/docs/sdk/core-modules/realtime/realtime/introduction#channels-and-channel-resources).\n\nWith the Site API, you can:\n\n- Use the [permissions router](https://dev.wix.com/docs/sdk/core-modules/realtime/realtime/site/permissions-router/introduction) to organize permission logic per channel or resource.\n- Control subscriber access using the [`realtime_check_permission` hook](https://dev.wix.com/docs/sdk/core-modules/realtime/realtime/site/realtime-check-permission).\n\n## Before you begin\n\nIt's important to note the following points before starting to code:\n
|
|
3852
|
+
"src": "---\narticleType: intro\n---\n\n# About the Site API\n\nThe Site API lets you control subscriber permissions for the [Realtime APIs](https://dev.wix.com/docs/sdk/core-modules/realtime/realtime/introduction). It determines which [subscribers](https://dev.wix.com/docs/sdk/core-modules/realtime/realtime/subscriber/introduction) can receive messages on specific [channels and resources](https://dev.wix.com/docs/sdk/core-modules/realtime/realtime/introduction#channels-and-channel-resources).\n\nWith the Site API, you can:\n\n- Use the [permissions router](https://dev.wix.com/docs/sdk/core-modules/realtime/realtime/site/permissions-router/introduction) to organize permission logic per channel or resource.\n- Control subscriber access using the [`realtime_check_permission` hook](https://dev.wix.com/docs/sdk/core-modules/realtime/realtime/site/realtime-check-permission).\n\n<blockquote class=\"important\">\n\n__Important:__\nYou can only use the Site API when [developing websites](https://dev.wix.com/docs/develop-websites-sdk/get-started/overview/about-developing-websites). When [building apps](https://dev.wix.com/docs/build-apps/get-started/overview/about-wix-apps), subscribers receive the default `{ read: true }` permissions.\n\nTo provide custom permission checks for channels your app manages, implement the [Realtime Permissions service plugin](https://dev.wix.com/docs/sdk/core-modules/realtime/extensions/realtime-permissions-provider/introduction). \n\nLearn more about [cross-app subscriptions](https://dev.wix.com/docs/sdk/core-modules/realtime/realtime/introduction#cross-app-subscriptions).\n\n</blockquote>\n\n\n## Before you begin\n\nIt's important to note the following points before starting to code:\n- In Wix Studio, you must create a `realtime-permissions.js` file in a site's backend, even if `realtime_check_permission` isn't defined. Without the file, subscriptions fail.\n- When the `realtime_check_permission` hook isn't defined, all subscribers receive the default permissions of `{\"read\": true}`.\n- When previewing a site, `read` permissions are always `true`.\n\n## Use cases\n\nRestrict a channel so only the Wix user can receive messages. Use the [permissions router](https://dev.wix.com/docs/sdk/core-modules/realtime/realtime/site/permissions-router/introduction) to add a handler that checks `subscriber.type`:\n\n```js\nimport { site } from \"@wix/realtime\";\nconst { permissionsRouter } = site;\n\npermissionsRouter.add({ name: \"owner-only\" }, (channel, subscriber) => {\n return { read: subscriber.type === \"USER\" };\n});\n\nexport function realtime_check_permission(channel, subscriber) {\n return permissionsRouter.check(channel, subscriber);\n}\n```\n\n## See also\n\n- [Realtime APIs](https://dev.wix.com/docs/sdk/core-modules/realtime/realtime/introduction)\n- [Permissions Router API](https://dev.wix.com/docs/sdk/core-modules/realtime/realtime/site/permissions-router/introduction)\n- [Subscriber API](https://dev.wix.com/docs/sdk/core-modules/realtime/realtime/subscriber/introduction)\n- [Publisher API](https://dev.wix.com/docs/sdk/core-modules/realtime/realtime/publisher/introduction)\n\n@sdk_package_setup\n"
|
|
3853
3853
|
},
|
|
3854
3854
|
{
|
|
3855
3855
|
"type": "GUIDE",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/realtime",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.53",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@wix/sdk": "^1.21.4",
|
|
49
49
|
"@wix/sdk-runtime": "^1.0.9",
|
|
50
50
|
"@wix/sdk-types": "^1.17.5",
|
|
51
|
-
"@wix/sdk_realtime_site": "1.0.
|
|
51
|
+
"@wix/sdk_realtime_site": "1.0.41",
|
|
52
52
|
"uuid": "^11.1.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"isRootPublicSdk": true
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
|
-
"falconPackageHash": "
|
|
75
|
+
"falconPackageHash": "2e602b06414212277ec6e85a7af21aa58905f996e764b3311b2f5437"
|
|
76
76
|
}
|