{"_id":"56731edc58c4890d00bb5439","__v":8,"category":{"_id":"56731b714b2a680d00524daf","project":"5564f26a1fd04c0d00dc9aaa","version":"5564f26a1fd04c0d00dc9aad","__v":1,"pages":["56731edc58c4890d00bb5439"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-12-17T20:30:41.290Z","from_sync":false,"order":3,"slug":"subscriptions","title":"Subscriptions"},"parentDoc":null,"user":"5564f227f0f70f0d00a9ab20","version":{"_id":"5564f26a1fd04c0d00dc9aad","project":"5564f26a1fd04c0d00dc9aaa","__v":15,"createdAt":"2015-05-26T22:23:38.671Z","releaseDate":"2015-05-26T22:23:38.671Z","categories":["5564f26b1fd04c0d00dc9aae","556741d17acd550d0075eaca","556741d87acd550d0075eacb","556742f87acd550d0075ead1","556781cd6976ef0d0099c545","5568d666d33aad0d00ec8d2e","557f6b2d38249b0d00d0d12b","55b67be9c2e909190073ed38","564e56c601e80e0d00396684","56731b714b2a680d00524daf","573612ac652bd80e00a90027","57365e2cf8ebd31700769f50","57366131f8ebd31700769f58","573b93514e029d19000b8669","573bbfdb7ac6f6170033bd35"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"project":"5564f26a1fd04c0d00dc9aaa","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-12-17T20:45:16.816Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"A device can subscribe to the messages from another device. This allows for messages to be forwarded from one device to another.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Security Configuration\",\n  \"body\": \"The device must have the appropriate whitelists configured in order to allow message forwarding.\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  receiveWhitelist: [ 'device-b' ]\\n}\",\n      \"language\": \"javascript\",\n      \"name\": \"Device A\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  configureWhitelist: [ 'device-a' ] \\n}\",\n      \"language\": \"javascript\",\n      \"name\": \"Device B\"\n    }\n  ]\n}\n[/block]\nWhen `Device A` subscribes to `Device B` received messages, the message will be automatically forwarded and emitted from `Device A`.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Required Whitelists\",\n  \"body\": \"`broadcast`: `configureWhitelist` or `receiveWhitelist`\\n`config`: `configureWhitelist` or `discoverWhitelist`\\n`received`: `configureWhitelist` or `receiveAsWhitelist`\\n`sent`: `configureWhitelist`\"\n}\n[/block]\nUse the [Subscription API](https://meshblu-http.readme.io/docs/subscriptions) to manage your subscriptions.","excerpt":"Server-Side Subscriptions","slug":"subscriptions","type":"basic","title":"Subscriptions (DEPRECATED)"}

Subscriptions (DEPRECATED)

Server-Side Subscriptions

A device can subscribe to the messages from another device. This allows for messages to be forwarded from one device to another. [block:callout] { "type": "warning", "title": "Security Configuration", "body": "The device must have the appropriate whitelists configured in order to allow message forwarding." } [/block] [block:code] { "codes": [ { "code": "{\n receiveWhitelist: [ 'device-b' ]\n}", "language": "javascript", "name": "Device A" } ] } [/block] [block:code] { "codes": [ { "code": "{\n configureWhitelist: [ 'device-a' ] \n}", "language": "javascript", "name": "Device B" } ] } [/block] When `Device A` subscribes to `Device B` received messages, the message will be automatically forwarded and emitted from `Device A`. [block:callout] { "type": "info", "title": "Required Whitelists", "body": "`broadcast`: `configureWhitelist` or `receiveWhitelist`\n`config`: `configureWhitelist` or `discoverWhitelist`\n`received`: `configureWhitelist` or `receiveAsWhitelist`\n`sent`: `configureWhitelist`" } [/block] Use the [Subscription API](https://meshblu-http.readme.io/docs/subscriptions) to manage your subscriptions.