You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(pusher): re-add server library, interoperability, and count details
Restore information from the old Pusher adapter FAQ that was dropped in
the transition to the current docs page:
- Server-side (REST) Pusher library configuration, including host,
app_id/key/secret split, and TLS option
- Note that Pusher and Ably client libraries can be used side by side
against the same channels
- User and subscriber count behaviour (presence-channel only, and the
distinction between the two)
Previously documented at:
https://support.ably.io/support/solutions/articles/3000055086-using-the-ably-pusher-protocol-adaptor/
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: src/pages/docs/protocols/pusher.mdx
+41-2Lines changed: 41 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,13 +63,14 @@ const pusher = new Pusher('appId.keyId', {
63
63
httpHost:'main.pusher.ably.net',
64
64
disableStats:true,
65
65
forceTls:true,
66
-
cluster:'eu'
66
+
cluster:'eu',
67
+
authEndpoint:'...',
67
68
});
68
69
```
69
70
</Code>
70
71
71
72
<Asidedata-type='note'>
72
-
You should only use your [Ably API key name](/docs/auth#format), not the full API key. This includes everything before the colon `:` in your API key.
73
+
You should only use your [Ably API key name](/docs/auth#format), not the full API key. This is the part before the colon `:`.
73
74
</Aside>
74
75
75
76
| Option | Description |
@@ -79,9 +80,40 @@ You should only use your [Ably API key name](/docs/auth#format), not the full AP
79
80
| disableStats | Disable the collection of stats in Pusher. |
80
81
| forceTls | Force the connection to use TLS. This isn't required but strongly recommended by Ably to avoid sending private keys over a plain text connection. |
81
82
| cluster | Set this to any value as it is required by Pusher. It has no impact on the Ably Pusher endpoint as Ably will use the closest data center available to the client. |
83
+
| authEndpoint | The address of your [auth server](#configure-rest), if you are using one. |
82
84
83
85
You can also add any other Pusher options that you normally use.
84
86
87
+
### Configure a Pusher server library <aid="configure-rest"/>
88
+
89
+
If doing anything other than subscribing to public channels, such as authorizing a client to access a private or presence channel or publishing from your backend, you will need to configure a Pusher server-side library to point at Ably. Using Ruby as an example:
90
+
91
+
<Code>
92
+
```ruby
93
+
Pusher::Client.new(
94
+
app_id:'appId',
95
+
key:'appId.keyId',
96
+
secret:'keySecret',
97
+
host:'main.pusher.ably.net',
98
+
use_tls:true
99
+
)
100
+
```
101
+
</Code>
102
+
103
+
All other Pusher server libraries are configured in a similar way.
104
+
105
+
| Option | Description |
106
+
|--------|-------------|
107
+
| app_id | Your Ably app ID. This is the part of the API key before the first dot. |
108
+
| key | Your Ably API [key name](/docs/auth#format). This is everything before the colon `:` in your API key. |
109
+
| secret | The secret portion of your API key. This is everything after the colon `:` in your API key. |
110
+
| host | Set the host to point to Ably: `main.pusher.ably.net`. |
111
+
| use_tls | Use TLS for the connection. This isn't required but is strongly recommended to avoid sending your API key secret over a plain text connection. |
112
+
113
+
<Asidedata-type='note'>
114
+
The adapter uses the standard Ably service behind the scenes, so you can use Pusher and Ably SDKs side-by-side against the same channels. For example, you can publish and subscribe using Pusher libraries, but use the [Ably REST API](/docs/api/rest-api) to retrieve [message history](/docs/storage-history/history), which isn't available through the Pusher libraries. Bear in mind [channel name mapping](#mapping) when mixing libraries.
115
+
</Aside>
116
+
85
117
## Channel mapping <aid="mapping"/>
86
118
87
119
Ably and Pusher have different naming restrictions for channel names, and use namespaces differently.
@@ -105,3 +137,10 @@ The following are some example channel name mappings:
105
137
| foo;bar | public:foo:bar |
106
138
| private-ablyroot-foo | foo |
107
139
| private-ablyroot-foo;bar | foo:bar |
140
+
141
+
## User and subscriber count <aid="counts"/>
142
+
143
+
Both user count and subscriber count currently only work on presence channels.
144
+
145
+
* User count returns the size of the presence set once it has been made unique by `clientId`.
146
+
* Subscriber count returns the raw size of the presence set.
0 commit comments