官方包 · 自动化与基础设施

用于实时页面、在线状态和审批的 Bubble 插件

在 Bubble 页面放一个 Hibira Channel 元素,工作流一发布事件,页面就立即更新:不用刷新页面、不用轮询,也不用配置 API Connector。presence 频道显示谁在线,审批让人在工作流继续之前做出决定。

  • 订单和工单实时跟踪:工作流发布 order-updated,所有打开的状态页面同时更新。
  • 聊天与协作:presence 频道列出在线的人,客户端事件显示谁正在输入。
  • 审批:超过额度的退款会等待,直到经理在链接上点“批准”或“拒绝”。
  • 私有和 presence 频道在普通工作流里用 Current User 授权,所以所有 Bubble 套餐都能用。

登录后,示例代码会自动填入您的集群主机。 登录

  1. 安装

    Plugins tab → Add plugins → search "Hibira Realtime" → Install
      App key:     YOUR_APP_KEY
      App ID:      YOUR_APP_ID
      App secret:  YOUR_APP_SECRET
      Host:        wss://ws.hibira.io
  2. 接收事件

    Hibira Channel element
      Channel:    "order-" & Current page's order's unique id
      Value key:  status
    
    When Hibira Channel A an event is received
      → Display data: Hibira Channel A's Last value
  3. 发送事件

    When Button Mark shipped is clicked
      → Hibira - Publish event
          Channels:  "order-" & Current page's order's unique id
          Event:     order-updated
          Data:      {"status": "shipped"}
  4. 私有和 presence 频道

    Channel: presence-room-42
    
    When Hibira Channel A authorization is needed
      1. Hibira - Authorize channel
           Socket ID:  Hibira Channel A's Auth socket ID
           Channel:    Hibira Channel A's Auth channel
           User ID:    Current User's unique id
           User name:  Current User's name
      2. Hibira Channel A Complete authorization
           Auth:          Result of step 1's Auth
           Channel data:  Result of step 1's Channel data
    
    Hibira Channel A's Member names → a list of who is online

开始之前

  • 把你的 Bubble 域名(例如 https://yourapp.bubbleapps.io 和自定义域名)加到应用的允许来源中。
  • 应用密钥保存在 Bubble 的私有插件设置里,只由服务器端操作使用,绝不会发送到浏览器。
  • 页面上所有 Hibira Channel 元素共享一个连接,所以一位访客在套餐连接数中只算一个。

请使用控制台中应用的 Key;Secret 只放在你的服务器上。频道、事件与授权端点的用法与 Pusher 完全相同。 免费创建账号 →