diff --git a/README.md b/README.md index 4d1e1fe..4f847dc 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,7 @@ Complete list of allowed configuration options | consoleLogs | Logs useful connection info if set to `true` | `false` | | notifySelf | Receive messages sent by self | `true` | | jwt | JWT authentication token | `null` | +| presence | Enable presence events, pass 1 to enabled | `0` | ## Development diff --git a/package.json b/package.json index 947f5e2..9b62064 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "piesocket-js", - "version": "1.1.1", + "version": "1.1.2", "description": "PieSocket Javascript Client", "main": "src/index.js", "unpkg": "dist/piesocket.js", diff --git a/src/PieSocket.js b/src/PieSocket.js index ca34c44..36e2ade 100644 --- a/src/PieSocket.js +++ b/src/PieSocket.js @@ -9,6 +9,7 @@ const defaultOptions = { consoleLogs: false, notifySelf: true, jwt: null, + presence: 0, } export default class PieSocket { @@ -54,7 +55,7 @@ export default class PieSocket { } getEndpoint(channelId) { - let endpoint = `wss://${this.options.clusterId}.piesocket.com/v${this.options.version}/${channelId}?api_key=${this.options.apiKey}¬ify_self=${this.options.notifySelf}&source=jssdk&v=${pjson.version}` + let endpoint = `wss://${this.options.clusterId}.piesocket.com/v${this.options.version}/${channelId}?api_key=${this.options.apiKey}¬ify_self=${this.options.notifySelf}&source=jssdk&v=${pjson.version}&presence=${this.options.presence}` if(this.options.jwt){ endpoint = endpoint+"&jwt="+this.options.jwt; }