# `PhoenixGenApi.ChannelHelpers`
[🔗](https://github.com/ohhi-vn/phoenix_gen_api/blob/main/lib/phoenix_gen_api/helpers/channel_helpers.ex#L1)

Shared push-handling logic for GenApi WebSocket channels.

Inject into a channel with `use PhoenixGenApi.ChannelHelpers`.

Provides common `handle_info` clauses for:
  - synchronous push results
  - streaming responses
  - async RPC call results

## Configuration

The event name used for pushing responses to the client can be configured
via the `:event` option. This should match the event name used in the
channel's `handle_in/3` clause.

    use PhoenixGenApi.ChannelHelpers, event: "my_custom_event"

By default, the event name is `"phoenix_gen_api"`, consistent with the
main `use PhoenixGenApi` macro.

## Migration from Previous Versions

Previously, this module hardcoded the event name as `"gen_api_result"`.
If you relied on that behavior, configure it explicitly:

    use PhoenixGenApi.ChannelHelpers, event: "gen_api_result"

---

*Consult [api-reference.md](api-reference.md) for complete listing*
