Per-instance configuration.
Resolves explicit options first (passed to PusherServer.start_link/1),
falling back to environment variables for anything omitted — the same
variables the standalone release reads. This is what lets the exact
same code run either as a hex dependency embedded in your own
supervision tree (config passed explicitly) or as a standalone release
configured purely by env vars, with zero code differences.
Options / environment variables
| Option | Env var | Default |
|---|---|---|
:app_key | PUSHER_APP_KEY | "app-key" |
:app_secret | PUSHER_APP_SECRET | "app-secret" (public; a warning is logged, always set your own) |
:app_id | PUSHER_APP_ID | "app-id" |
:port | PORT | 6001 |
:webhook_url | PUSHER_WEBHOOK_URL | none |
:client_messages_enabled | PUSHER_ENABLE_CLIENT_MESSAGES | true |
:redis_url | PUSHER_REDIS_URL | none (single node) |
:redis_opts | — | [] (extra Redix options, e.g. ssl: true) |
:webhook_retries | PUSHER_WEBHOOK_RETRIES | 3 (retries after the first attempt; 0 disables) |
:webhook_retry_base_ms | — | 1000 (delay doubles on each retry) |
:rest_rate_limit | PUSHER_REST_RATE_LIMIT | none (max REST API requests per second, per instance) |
:client_event_rate_limit | PUSHER_CLIENT_EVENT_RATE_LIMIT | none (max client events per second, per connection) |
:max_connections | PUSHER_MAX_CONNECTIONS | none (max WebSocket connections on this node) |
:batch_limit | PUSHER_BATCH_LIMIT | 10 (max events per batch_events request) |
:metrics | PUSHER_METRICS | false (serve Prometheus metrics at GET /metrics) |
:metrics_token | PUSHER_METRICS_TOKEN | none (if set, /metrics requires Authorization: Bearer <token>) |
Setting :redis_url switches the instance to the Redis backend so
several nodes can share channels, presence and broadcasts. Without it,
the instance runs fully in-memory and needs nothing but this library.
Summary
Types
@type t() :: %PusherServer.Config{ app_id: term(), app_key: term(), app_secret: term(), backend: term(), batch_limit: term(), client_event_rate_limit: term(), client_messages_enabled: term(), max_connections: term(), metrics: term(), metrics_token: term(), node_id: term(), port: term(), prefix: term(), redis_opts: term(), redis_url: term(), rest_rate_limit: term(), webhook_retries: term(), webhook_retry_base_ms: term(), webhook_url: term() }