{"id":21223235,"url":"https://github.com/renddslow/onesignal-promise-nodejs","last_synced_at":"2025-03-15T01:30:06.609Z","repository":{"id":57314682,"uuid":"110888487","full_name":"Renddslow/onesignal-promise-nodejs","owner":"Renddslow","description":null,"archived":false,"fork":false,"pushed_at":"2017-11-21T15:21:07.000Z","size":2066,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-21T22:47:32.041Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Renddslow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-15T21:27:34.000Z","updated_at":"2017-12-02T12:16:27.000Z","dependencies_parsed_at":"2022-09-12T15:01:50.058Z","dependency_job_id":null,"html_url":"https://github.com/Renddslow/onesignal-promise-nodejs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Renddslow%2Fonesignal-promise-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Renddslow%2Fonesignal-promise-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Renddslow%2Fonesignal-promise-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Renddslow%2Fonesignal-promise-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Renddslow","download_url":"https://codeload.github.com/Renddslow/onesignal-promise-nodejs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243670970,"owners_count":20328558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T22:50:44.107Z","updated_at":"2025-03-15T01:30:06.586Z","avatar_url":"https://github.com/Renddslow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OneSignal Promise SDK\nA super simple promise-based node sdk for creating, canceling, and view notifications in OneSignal.\n\n# Super simple to use\n```js\nconst oneSignal = require('onesignal-promise')({ appId: 'APP_ID', apiKey: 'API_KEY' });\noneSignal.createNotification({ contents: {'en': 'Hello World'} })\n\t.then(res =\u003e {\n\t\tif (!res.errors) {\n\t\t\tconsole.log(res.id);\n\t\t}\n\t});\n```\n\n# Installation\n```\nnpm install --save onesignal-promise\n```\n\n# Methods\n\n## `createNotification`\nExpects a OneSignal [notification object](https://documentation.onesignal.com/reference#create-notification) and MUST include either a `contents` object or have `content_available` set to `true` or it will throw.\n\n### Responses\n`200 OK`\n```\n{\n\tid: '458dcec4-cf53-11e3-add2-000c2940e62c',\n\trecipients: 3\n}\n```\n\n`400 Bad Request`\n```\n{\n\terrors: ['Notification content must not be null for any languages.']\n}\n```\n\n`200 No Subscribed Players`\nMade if no phones are subscribed to a segment\n```\n{\n\tid: '',\n\trecipients: 0,\n\terrors: ['All included players are not subscribed']\n}\n```\n\n## `cancelNotification`\nExpects an id of an existing notification.\n\n```\nonesignal.cancelNotification('6392d91a-b206-4b7b-a620-cd68e32c3a76')\n\t.then(result =\u003e {\n\t\tconsole.log(result)\n\t})\n\n\u003e\u003e\u003e { success: true }\n```\n`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenddslow%2Fonesignal-promise-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frenddslow%2Fonesignal-promise-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenddslow%2Fonesignal-promise-nodejs/lists"}