Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/channels/getting_started/javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ var pusher = new Pusher({
cluster: "APP_CLUSTER",
});

pusher.trigger("my-channel", "my-event", { message: "hello world" });
await pusher.trigger("my-channel", "my-event", { message: "hello world" });
```

```php
Expand Down
4 changes: 2 additions & 2 deletions docs/channels/server_api/excluding-event-recipients.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ const pusher = new Pusher({
useTLS: true,
});

app.post("/trigger", (req, res) => {
app.post("/trigger", async (req, res) => {
const socketId = req.body.socket_id;
pusher.trigger(
await pusher.trigger(
"my-channel",
"my-event",
{
Expand Down
10 changes: 5 additions & 5 deletions docs/channels/server_api/http-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const pusher = new Pusher({
useTLS: true,
});

pusher.trigger(channels, event, data, socketId).catch((error) => {
await pusher.trigger(channels, event, data, socketId).catch((error) => {
console.log(error);
});
```
Expand Down Expand Up @@ -358,7 +358,7 @@ const pusher = new Pusher({
cluster: "APP_CLUSTER",
});

pusher.trigger("my-channel", "my-event", {
await pusher.trigger("my-channel", "my-event", {
message: "hello world",
});
```
Expand Down Expand Up @@ -453,7 +453,7 @@ const pusher = new Pusher({
});

const channels = ["my-channel-1", "my-channel-2", "my-channel-3"];
pusher.trigger(channels, "my-event", {
await pusher.trigger(channels, "my-event", {
message: "hello world",
});
```
Expand Down Expand Up @@ -600,7 +600,7 @@ const events = [
},
];

pusher.triggerBatch(events);
await pusher.triggerBatch(events);
```

```py
Expand All @@ -626,7 +626,7 @@ For the channels that were published to, you can request for the number of subsc

This is currently only supported in the PHP, Node.js and Go SDKs.

{% snippets ['php', 'js', 'go'] %}
{% snippets ['php', 'node', 'go'] %}

```php
$batch = array();
Expand Down
2 changes: 1 addition & 1 deletion docs/channels/server_api/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const pusher = new Pusher({
useTLS: true,
});

pusher.trigger("my-channel", "my-event", {
await pusher.trigger("my-channel", "my-event", {
message: "hello world",
});
```
Expand Down
4 changes: 2 additions & 2 deletions docs/channels/server_api/server-to-user-messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ Check:
- The [Server user authentication docs](/docs/channels/server_api/authenticating-users) for information on how to create a user authentication endpoint.

{% methodwrap %}
{% snippets ['js', 'php'], true %}
{% snippets ['node', 'php'], true %}

```js
pusher.sendToUser("user-id", "event-name", { message: "hello world" });
await pusher.sendToUser("user-id", "event-name", { message: "hello world" });
```

```php
Expand Down