{"id":22281643,"url":"https://github.com/parse-community/parse-server-push-adapter","last_synced_at":"2025-05-15T04:00:25.699Z","repository":{"id":6079435,"uuid":"54730584","full_name":"parse-community/parse-server-push-adapter","owner":"parse-community","description":"A push notification adapter for Parse Server","archived":false,"fork":false,"pushed_at":"2025-05-05T20:04:10.000Z","size":2575,"stargazers_count":95,"open_issues_count":23,"forks_count":105,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-05-05T20:43:22.810Z","etag":null,"topics":["hacktoberfest","parse-server"],"latest_commit_sha":null,"homepage":"https://parseplatform.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parse-community.png","metadata":{"funding":{"github":"parse-community","patreon":null,"open_collective":"parse-server","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null},"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-03-25T16:15:47.000Z","updated_at":"2025-05-05T20:04:12.000Z","dependencies_parsed_at":"2023-10-25T00:34:34.626Z","dependency_job_id":"9b1ee296-75ce-46b9-bf64-bf31da0e3137","html_url":"https://github.com/parse-community/parse-server-push-adapter","commit_stats":{"total_commits":174,"total_committers":32,"mean_commits":5.4375,"dds":0.8793103448275862,"last_synced_commit":"300b9bb03d8e80e646bfa67f26da4a9e473f4dbd"},"previous_names":["parse-server-modules/parse-server-push-adapter"],"tags_count":62,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parse-community%2Fparse-server-push-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parse-community%2Fparse-server-push-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parse-community%2Fparse-server-push-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parse-community%2Fparse-server-push-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parse-community","download_url":"https://codeload.github.com/parse-community/parse-server-push-adapter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253328403,"owners_count":21891468,"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":["hacktoberfest","parse-server"],"created_at":"2024-12-03T16:20:04.024Z","updated_at":"2025-05-15T04:00:25.674Z","avatar_url":"https://github.com/parse-community.png","language":"JavaScript","funding_links":["https://github.com/sponsors/parse-community","https://opencollective.com/parse-server"],"categories":[],"sub_categories":[],"readme":"# Parse Server Push Adapter \u003c!-- omit in toc --\u003e\n\n[![Build Status](https://github.com/parse-community/parse-server-push-adapter/actions/workflows/ci.yml/badge.svg)](https://github.com/parse-community/parse-server-push-adapter/actions/workflows/ci.yml)\n[![Snyk Badge](https://snyk.io/test/github/parse-community/parse-server-push-adapter/badge.svg)](https://snyk.io/test/github/parse-community/parse-server-push-adapter)\n[![Coverage](https://img.shields.io/codecov/c/github/parse-community/parse-server-push-adapter/master.svg)](https://codecov.io/github/parse-community/parse-server-push-adapter?branch=master)\n[![auto-release](https://img.shields.io/badge/%F0%9F%9A%80-auto--release-9e34eb.svg)](https://github.com/parse-community/parse-server-push-adapter/releases)\n\n[![Node Version](https://img.shields.io/badge/nodejs-18,_20,_22-green.svg?logo=node.js\u0026style=flat)](https://nodejs.org)\n\n[![npm latest version](https://img.shields.io/npm/v/@parse/push-adapter.svg)](https://www.npmjs.com/package/@parse/push-adapter)\n\n---\n\nThe official Push Notification adapter for Parse Server. See [Parse Server Push Configuration](http://docs.parseplatform.org/parse-server/guide/#push-notifications) for more details.\n\n---\n\n- [Installation](#installation)\n- [Configure Parse Server](#configure-parse-server)\n  - [Apple Push Options](#apple-push-options)\n  - [Android Push Options](#android-push-options)\n  - [Firebase Cloud Messaging (FCM)](#firebase-cloud-messaging-fcm)\n    - [Google Cloud Service Account Key](#google-cloud-service-account-key)\n    - [Migration to FCM HTTP v1 API (June 2024)](#migration-to-fcm-http-v1-api-june-2024)\n    - [HTTP/1.1 Legacy Option](#http11-legacy-option)\n    - [Firebase Client Error](#firebase-client-error)\n  - [Expo Push Options](#expo-push-options)\n- [Bundled with Parse Server](#bundled-with-parse-server)\n- [Logging](#logging)\n\n## Installation\n\n```shell\nnpm install --save @parse/push-adapter@\u003cVERSION\u003e\n```\n\nReplace `\u003cVERSION\u003e` with the version you want to install.\n\n## Configure Parse Server\n\n```js\nimport { ParsePushAdapter } from '@parse/push-adapter';\n\n// For CommonJS replace the import statemtent above with the following line:\n// const ParsePushAdapter = require('@parse/push-adapter').default;\n\nconst parseServerOptions = {\n  push: {\n    adapter: new ParsePushAdapter({\n      ios: {\n        // Apple push options\n      },\n      android: {\n        // Android push options\n      },\n      web: {\n        // Web push options\n      },\n      expo: {\n        // Expo push options\n      }\n    })\n  }\n  // Other Parse Server options\n};\n```\n\n### Apple Push Options\n\nParse Server Push Adapter currently supports these types of Apple ecosystems:\n\n- `ios`: iPhone, iPad, and iPod touch apps\n- `osx`: macOS, and macCatalyst apps\n- `tvos`: tvOS apps\n- `watchos`: watchOS apps\n\nPush notifications can be delivered to Apple devices either via Apple Push Notification Service (APNS) or Firebase Cloud Messaging (FMC). Note that each category of Apple devices requires their own configuration section:\n\n- APNS requires a private key that can be downloaded from the Apple Developer Center at https://developer.apple.com/account under _Certificates \u003e Identifiers \u0026 Profiles._ The adapter options also require the app ID and team ID, which can be found there.\n- FCM requires a private key that can be downloaded from the Firebase Console at https://console.firebase.google.com in your project under _Settings \u003e Cloud Messaging._\n\nExample options:\n\nBoth services (APNS, FCM) can be used in combination for different Apple ecosystems.\n\n```js\nios: {\n  // Deliver push notifications to iOS devices via APNS\n  token: {\n    key: __dirname + '/apns.p8',\n    keyId: '\u003cAPNS_KEY_ID\u003e',\n    teamId: '\u003cAPNS_TEAM_ID\u003e'\n  },\n  topic: '\u003cBUNDLE_IDENTIFIER\u003e',\n  production: true\n},\nosx: {\n  // Deliver push notifications to macOS devices via FCM\n  firebaseServiceAccount: __dirname + '/firebase.json'\n}\n```\n\n### Android Push Options\n\nDelivering push notifications to Android devices can be done via Firebase Cloud Messaging (FCM):\n\n- FCM requires a private key that can be downloaded from the Firebase Console at https://console.firebase.google.com in your project under _Settings \u003e Cloud Messaging._\n\nExample options:\n\n```js\nandroid: {\n  firebaseServiceAccount: __dirname + '/firebase.json'\n}\n```\n\n### Firebase Cloud Messaging (FCM)\n\nThis section contains some considerations when using FCM, regardless of the destination ecosystems the push notification is sent to.\n\n#### Google Cloud Service Account Key\n\nThe Firebase console allows to easily create and download a Google Cloud service account key JSON file with the required permissions. Instead of setting `firebaseServiceAccount` to the path of the JSON file, you can provide an object representing a Google Cloud service account key:\n\n```js\nandroid: {\n  firebaseServiceAccount: {\n    projectId: '\u003cPROJECT_ID\u003e',\n    clientEmail: 'example@\u003cPROJECT_ID\u003e.iam.gserviceaccount.com',\n    privateKey: '-----BEGIN PRIVATE KEY-----\u003cKEY\u003e-----END PRIVATE KEY-----\\n'\n  }\n}\n```\n\nThis can be helpful if you are already managing credentials to Google Cloud APIs in other parts of your code and you want to reuse these credentials, or if you want to manage credentials on a more granular level directly in Google Cloud. Make sure that the service account has the permission `cloudmessaging.messages.create` which is for example part of role `Firebase Cloud Messaging API Admin`.\n\n#### Migration to FCM HTTP v1 API (June 2024)\n\n⚠️ Sending push notifications to Android devices via the FCM legacy API was deprecated on June 20 2023 and was announced to be decommissioned in June 2024. See [Google docs](https://firebase.google.com/docs/cloud-messaging/migrate-v1). To send push notifications to the newer FCM HTTP v1 API you need to update your existing push configuration for Android by replacing the key `apiKey` with `firebaseServiceAccount`.\n\nExample options (deprecated):\n\n```js\nandroid: {\n  // Deliver push notifications via FCM legacy API (deprecated)\n  apiKey: '\u003cAPI_KEY\u003e'\n}\n```\n\n#### HTTP/1.1 Legacy Option\n\nWith the introduction of the FCM HTTP v1 API, support for HTTP/2 was added which provides faster throughput for push notifications. To use the older version HTTP/1.1 set `fcmEnableLegacyHttpTransport: true` in your push options.\n\nExample options:\n\n```js\nandroid: {\n  firebaseServiceAccount: __dirname + '/firebase.json',\n  fcmEnableLegacyHttpTransport: true\n}\n```\n\n#### Firebase Client Error\n\nOccasionally, errors within the Firebase Cloud Messaging (FCM) client may not be managed internally and are instead passed to the Parse Server Push Adapter. These errors can occur, for instance, due to unhandled FCM server connection issues.\n\n- `resolveUnhandledClientError: true`: Logs the error and gracefully resolves it, ensuring that push sending does not result in a failure.\n- `resolveUnhandledClientError: false`: Causes push sending to fail, returning a `Parse.Error.OTHER_CAUSE` with error details that can be parsed to handle it accordingly. This is the default.\n\nIn both cases, detailed error logs are recorded in the Parse Server logs for debugging purposes.\n\n### Expo Push Options\n\nExample options:\n\n```js\nexpo: {\n  accessToken: '\u003cEXPO_ACCESS_TOKEN\u003e'\n}\n```\n\nFor more information see the [Expo docs](https://docs.expo.dev/push-notifications/overview/).\n\n## Bundled with Parse Server\n\nParse Server already comes bundled with a specific version of the push adapter. This installation is only necessary when customizing the push adapter version that should be used by Parse Server. When using a customized version of the push adapter, ensure that it's compatible with the version of Parse Server you are using.\n\nWhen using the bundled version, it is not necessary to initialize the push adapter in code and the push options are configured directly in the `push` key, without the nested `adapter` key:\n\n```js\nconst parseServerOptions = {\n  push: {\n    ios: {\n      // Apple push options\n    }\n    // Other push options\n  }\n  // Other Parse Server options\n};\n```\n\n## Logging\n\nYou can enable verbose logging to produce a more detailed output for all push sending attempts with the following environment variables:\n\n```js\nVERBOSE=1\n```\n\nor\n\n```js\nVERBOSE_PARSE_SERVER_PUSH_ADAPTER=1\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparse-community%2Fparse-server-push-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparse-community%2Fparse-server-push-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparse-community%2Fparse-server-push-adapter/lists"}