{"_id":"56ad305879011b0d00c32aaa","version":{"_id":"56acd71213ac890d001c3c7d","project":"56acd71213ac890d001c3c7a","__v":15,"createdAt":"2016-01-30T15:30:26.928Z","releaseDate":"2016-01-30T15:30:26.928Z","categories":["56acd71313ac890d001c3c7e","56acd8f113ac890d001c3c81","56acd8f95ac4060d0027865e","56acd93a13ac890d001c3c82","56ad20660ab3c00d00ce3347","56ad356a2a7860170013f714","56ad47eb0ab3c00d00ce334f","56afd523bc304a0d00ace1df","56b29a019621f20d00efb37e","56b657e11bc6970d009feee7","5845cc3c39950c1b002afe77","5845cde163c11b250037967e","5846efd45d064323007b17b4","588604da4674e32300efd160","588627882393d50f00f1322c"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"user":"56acd6caa040860d00ac94a2","githubsync":"","project":"56acd71213ac890d001c3c7a","__v":1,"category":{"_id":"56ad20660ab3c00d00ce3347","__v":11,"pages":["56ad21651c09150d00a183a0","56ad235c693f0a0d0085f0c3","56ad24afd21f1b0d00fd2f86","56ad2e5b1c09150d00a183a6","56ad305879011b0d00c32aaa","56ad30c81a7ee417009ced18","56ad31432a7860170013f711","56ad33b21a7ee417009ced1a","56ad34a0b9ac5517006b6962","56ad35503fc1020d009776e1","56e7266bdbc36117006a41ff"],"project":"56acd71213ac890d001c3c7a","version":"56acd71213ac890d001c3c7d","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-30T20:43:18.400Z","from_sync":false,"order":9,"slug":"singularity-real-time-events","title":"Singularity: Real-Time Events"},"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-01-30T21:51:20.048Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"Using Socket.IO this benefit can be listened to as follows:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"socket.on('benefit-fulfilled', function(data){\\n    //Do something.                        \\n});\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\nThis event fires when a channel fulfills a benefit. The structure of the response is similar to the [subscriber-benefits-change](https://gamewisp.readme.io/docs/subscriber-benefits-change) except that the benefits array only contains the benefit-fulfillment pair of the fulfilled benefit.\n\nThis event only fires for benefits that the channel fulfills manually through the GameWisp channel dashboard.","excerpt":"Fires whenever a benefit is fulfilled by a GameWisp channel","slug":"benefit-fulfilled","type":"fn","title":"benefit-fulfilled"}

benefit-fulfilled

Fires whenever a benefit is fulfilled by a GameWisp channel

Using Socket.IO this benefit can be listened to as follows: [block:code] { "codes": [ { "code": "socket.on('benefit-fulfilled', function(data){\n //Do something. \n});", "language": "javascript" } ] } [/block] This event fires when a channel fulfills a benefit. The structure of the response is similar to the [subscriber-benefits-change](https://gamewisp.readme.io/docs/subscriber-benefits-change) except that the benefits array only contains the benefit-fulfillment pair of the fulfilled benefit. This event only fires for benefits that the channel fulfills manually through the GameWisp channel dashboard.