{"id":112678,"plugin_id":"plugin_asdk_app_6af301f5f7c08191b8b2f2581e9bb44d","kind":"skill","collection_source":"plugin_package","comparison_source":null,"observed_at":"2026-11-24T06:10:59.300Z","digest":"cb23eb9f6cdd8c5768037d4f2e338a584476488310b56fe73bf8c5e7d817cb22","against":null,"payload":{"description":"Add Hibira realtime channels (WebSockets, Pusher protocol) to a web, mobile or backend project. Use when building live updates, chat, notifications in the page, online counts, presence, collaborative features or dashboards with Hibira, or when choosing between public, private, presence and large presence channels.","included_files":[],"name":"realtime-integration","skill_md_contents":"---\nname: realtime-integration\ndescription: Add Hibira realtime channels (WebSockets, Pusher protocol) to a web, mobile or backend project. Use when building live updates, chat, notifications in the page, online counts, presence, collaborative features or dashboards with Hibira, or when choosing between public, private, presence and large presence channels.\n---\n\n# Hibira realtime integration\n\nHibira is a hosted WebSocket service that speaks the **Pusher Channels protocol**. Any Pusher Channels library that lets you set the host works: `pusher-js`, Laravel Echo, and the official server libraries for Node, PHP, Python, Go, Ruby, Java and .NET. You point them at Hibira instead of pusher.com.\n\n## Get the exact setup\n\nIf the Hibira MCP server is connected, call `get_integration_guide` for the project's SDK and follow it: it carries the app's real ID, key, host and cluster. Otherwise the guides are at https://hibira.io/guides. Hibira's own packages:\n\n| Stack | Package |\n|---|---|\n| Any web page, no build step | `<script src=\"https://hibira.io/embed/v1.js\" data-key=... data-host=... async>` |\n| Laravel | `composer require hibira-io/laravel` then `php artisan hibira:install` |\n| Flutter / Dart | `flutter pub add hibira` (the official pusher_channels_flutter cannot change its host) |\n| Large rooms | `@hibira-io/large-presence` |\n\n## Connection settings\n\nAlways pass host, port and TLS. The libraries default to pusher.com and silently connect there otherwise.\n\n- Host: `ws.hibira.io` (or the regional host `get_app` reports, `ws-<cluster>.hibira.io`), port 443, TLS on.\n- Cluster: the app's cluster (`hkg`, `tyo` or `sin`). Libraries that require a cluster ignore it once the host is set, but still need a value.\n\n```js\nimport Pusher from 'pusher-js';\n\nconst pusher = new Pusher(import.meta.env.VITE_HIBIRA_KEY, {\n  cluster: 'hkg',\n  wsHost: 'ws.hibira.io',\n  wsPort: 443,\n  wssPort: 443,\n  forceTLS: true,\n  enabledTransports: ['ws', 'wss'],\n  channelAuthorization: { endpoint: '/broadcasting/auth', transport: 'ajax' },\n});\n```\n\n```js\n// server\nconst Pusher = require('pusher');\nconst hibira = new Pusher({\n  appId: process.env.HIBIRA_APP_ID,\n  key: process.env.HIBIRA_KEY,\n  secret: process.env.HIBIRA_SECRET,\n  host: 'ws.hibira.io',\n  port: '443',\n  useTLS: true,\n});\nawait hibira.trigger('orders', 'order-shipped', { id: 1024 });\n```\n\n## Rules\n\n1. Look at the project first and follow its conventions for config, env variables and where integrations live.\n2. One shared client per process (a module, service or provider), not one per request or component.\n3. **The app secret stays on the server.** Browser and mobile code only get the key. Never commit real values; add placeholders to `.env.example`.\n4. Unsubscribe and unbind when a component or widget is disposed.\n5. Pick the channel type:\n   - `orders`: public, anyone with the key can listen.\n   - `private-...`: the client asks your backend's auth route, which checks the session and signs with the secret (`pusher.authorizeChannel()`).\n   - `presence-...`: private plus a member list with user info; fine up to a few hundred members.\n   - `presence-large-...`: up to 100,000 members; subscribers get a count, a sample and batched deltas once a second. Use `@hibira-io/large-presence` (or `window.Hibira.largePresence` with the embed script).\n6. Client events (`client-...`) must be turned on in the app settings and only work on private and presence channels.\n7. The browser origin must be in the app's allowed origins, or the connection is refused. Add `http://localhost:<port>` for local development.\n8. Channel history (Hobby plan and up, turned on per app) lets a client catch up after a reconnect with `pusher:rewind`.\n9. Webhooks are Pusher-compatible (`X-Pusher-Signature`), so `pusher.webhook(request)` and existing handlers work unchanged. Endpoints must be public https.\n\n## Verify\n\nPublish a test event (MCP `send_test_event`, or the Debug console on the app page) on a channel the code subscribes to and watch it arrive. Tell the user which files changed and where to fill in the secret.\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}