Skip to content

Commit b5c4eae

Browse files
authored
Merge pull request #2 from BenRoss92/master
Update old branch with latest commits from upstream
2 parents b44188b + 3b59485 commit b5c4eae

File tree

1 file changed

+15
-31
lines changed

1 file changed

+15
-31
lines changed

README.md

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,27 @@ Creating a new Pusher `client` can be done as follows.
2525

2626
``` ruby
2727
pusher_client = Pusher::Client.new(
28-
app_id: 'your-pusher-app-id',
29-
key: 'your-pusher-key',
30-
secret: 'your-pusher-secret'
28+
app_id: 'your-app-id',
29+
key: 'your-app-key',
30+
secret: 'your-app-secret',
31+
cluster: 'your-app-cluster',
3132
)
3233
```
34+
The cluster value will set the `host` to `api-<cluster>.pusher.com`.
3335

3436
If you want to set a custom `host` value for your client then you can do so when instantiating a Pusher client like so:
3537

3638
``` ruby
3739
pusher_client = Pusher::Client.new(
38-
app_id: 'your-pusher-app-id',
39-
key: 'your-pusher-key',
40-
secret: 'your-pusher-secret',
41-
host: 'your-pusher-host'
40+
app_id: 'your-app-id',
41+
key: 'your-app-key',
42+
secret: 'your-app-secret',
43+
host: 'your-app-host'
4244
)
4345
```
4446

45-
If you created your app in a different cluster to the default cluster, you must pass the `cluster` option as follows:
47+
If you pass both `host` and `cluster` options, the `host` will take precendence and `cluster` will be ignored.
4648

47-
``` ruby
48-
pusher_client = Pusher::Client.new(
49-
app_id: 'your-pusher-app-id',
50-
key: 'your-pusher-key',
51-
secret: 'your-pusher-secret',
52-
cluster: 'your-app-cluster'
53-
)
54-
```
55-
56-
This will set the `host` to `api-<cluster>.pusher.com`. If you pass both `host` and `cluster` options, the `host` will take precendence and `cluster` will be ignored.
5749

5850
Finally, if you have the configuration set in an `PUSHER_URL` environment
5951
variable, you can use:
@@ -67,18 +59,13 @@ pusher_client = Pusher::Client.from_env
6759
Configuring Pusher can also be done globally on the Pusher class.
6860

6961
``` ruby
70-
Pusher.app_id = 'your-pusher-app-id'
71-
Pusher.key = 'your-pusher-key'
72-
Pusher.secret = 'your-pusher-secret'
73-
```
74-
75-
If you created your app in a different cluster to the default cluster, you must set it as follows:
76-
77-
``` ruby
62+
Pusher.app_id = 'your-app-id'
63+
Pusher.key = 'your-app-key'
64+
Pusher.secret = 'your-app-secret'
7865
Pusher.cluster = 'your-app-cluster'
7966
```
8067

81-
Global configuration will automatically be set from the `PUSHER_URL` environment variable if it exists. This should be in the form `http://KEY:SECRET@api.pusherapp.com/apps/APP_ID`. On Heroku this environment variable will already be set.
68+
Global configuration will automatically be set from the `PUSHER_URL` environment variable if it exists. This should be in the form `http://KEY:SECRET@HOST/apps/APP_ID`. On Heroku this environment variable will already be set.
8269

8370
If you need to make requests via a HTTP proxy then it can be configured
8471

@@ -287,8 +274,6 @@ pusher.notify(["my-favourite-interest"], data)
287274

288275
Push notification requests, once submitted to the service are executed asynchronously. To make reporting errors easier, you can supply a `webhook_url` field in the body of the request. This will be used by the service to send a webhook to the supplied URL if there are errors.
289276

290-
You may also supply a `webhook_level` field in the body, which can either be INFO or DEBUG. It defaults to INFO - where INFO only reports customer facing errors, while DEBUG reports all errors.
291-
292277
For example:
293278

294279
```ruby
@@ -306,8 +291,7 @@ data = {
306291
icon: "icon"
307292
}
308293
},
309-
webhook_url: "http://yolo.com",
310-
webhook_level: "INFO"
294+
webhook_url: "http://yolo.com"
311295
}
312296
```
313297

0 commit comments

Comments
 (0)