Skip to content

Support client events (client-*) #13

Description

@stephenjason89

Goal

Allow clients to trigger client-* prefixed events on private and presence channels (pusher-js channel.trigger('client-foo', data)), per the Pusher protocol. Currently these arrive at handleWebSocketMessage and hit the "Unhandled Event" branch.

Requirements (per Pusher spec)

  • Only allow on private- / presence- channels the sender is actually subscribed to; reject elsewhere with a pusher:error
  • Broadcast to all other subscribers, excluding the sender (ws.publish does this natively in Bun)
  • Enforce the event-name prefix client- and a payload size limit (Pusher: 10KB)
  • Optionally emit the client_event webhook once webhook support (Webhook Support #3) expands

Depends on per-channel subscription state (#12) to verify the sender's membership.

Promoted from the README "Contributing > Client-Side Events" section so it can be tracked.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions