@quatrain/messaging-firebase 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -0
- package/package.json +4 -4
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# @quatrain/messaging-firebase
|
|
2
|
+
|
|
3
|
+
The Firebase Cloud Messaging (FCM) adapter for `@quatrain/messaging`.
|
|
4
|
+
|
|
5
|
+
## Introduction
|
|
6
|
+
|
|
7
|
+
Firebase Cloud Messaging is an industry-standard solution for sending push notifications to iOS, Android, and Web clients. This adapter implements the Quatrain messaging interface using the Firebase Admin SDK.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @quatrain/messaging-firebase firebase-admin
|
|
13
|
+
# or
|
|
14
|
+
yarn add @quatrain/messaging-firebase firebase-admin
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Configuration
|
|
18
|
+
|
|
19
|
+
Register the adapter using your Firebase service account credentials.
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { Messaging } from '@quatrain/messaging'
|
|
23
|
+
import { FirebaseMessagingAdapter } from '@quatrain/messaging-firebase'
|
|
24
|
+
|
|
25
|
+
const fcmAdapter = new FirebaseMessagingAdapter({
|
|
26
|
+
config: {
|
|
27
|
+
projectId: 'your-project-id',
|
|
28
|
+
clientEmail: 'firebase-adminsdk-xxx@your-project-id.iam.gserviceaccount.com',
|
|
29
|
+
privateKey: '-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n'
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
Messaging.addAdapter('push', fcmAdapter, true)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## License
|
|
37
|
+
|
|
38
|
+
AGPL-3.0-only
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quatrain/messaging-firebase",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
],
|
|
14
14
|
"author": "Quatrain Développement SAS <developers@quatrain.com>",
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"@quatrain/core": "^1.1.
|
|
16
|
+
"@quatrain/core": "^1.1.49"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@quatrain/core": "^1.1.
|
|
20
|
-
"@quatrain/messaging": "^1.0.
|
|
19
|
+
"@quatrain/core": "^1.1.49",
|
|
20
|
+
"@quatrain/messaging": "^1.0.11",
|
|
21
21
|
"firebase-admin": "^13.0.1"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|