You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,26 @@
1
1
# Copilot Instructions for AI Agents
2
2
3
3
## Project Overview
4
+
4
5
This repository implements a Node.js module for sending push notifications across multiple platforms: Apple (APN), Google (GCM/FCM), Windows (WNS), Amazon (ADM), and Web-Push. The core logic is in `lib/` and `src/`, with each platform handled by a dedicated file (e.g., `sendAPN.js`, `sendFCM.js`).
5
6
6
7
## Architecture & Data Flow
8
+
7
9
-**Entry Point:** Use `PushNotifications` from `lib/index.js` or `src/index.js`.
8
10
-**Settings:** Each platform's credentials/config are passed to the constructor. See the example in `README.md`.
9
11
-**Sending:** The main method is `push.send(registrationIds, data, callback)` or as a Promise. It auto-detects device type and routes to the correct sender.
10
12
-**Platform Senders:** Each sender (e.g., `sendAPN.js`, `sendFCM.js`) implements the logic for its platform. Shared utilities are in `lib/utils/` and `src/utils/`.
11
13
-**RegId Detection:** Device type is inferred from the registration ID structure. See `PN.getPushMethodByRegId` for details.
12
14
13
15
## Developer Workflows
16
+
14
17
-**Install:**`npm install`
15
18
-**Test:** Run all tests with `npm test`. Tests are in `test/` and cover basic flows and platform-specific cases.
16
19
-**Debug:** Use the callback or Promise error/result from `push.send`. Each result object includes method, success/failure counts, and error details per device.
17
20
-**Build:** No build step required for basic usage. ES6 is used, but compatible with ES5 via Babel if needed.
18
21
19
22
## Conventions & Patterns
23
+
20
24
-**Platform-specific files:** Each push service has its own file for isolation and clarity.
21
25
-**Unified Data Model:** The `data` object for notifications is normalized across platforms. See `README.md` for all supported fields.
22
26
-**Error Handling:** Errors are unified and returned in the result array from `push.send`.
@@ -25,6 +29,7 @@ This repository implements a Node.js module for sending push notifications acros
25
29
-**Constants:** Use constants from `constants.js` for platform types.
26
30
27
31
## Integration Points
32
+
28
33
-**External Libraries:**
29
34
- APN: `node-apn`
30
35
- FCM: `firebase-admin`
@@ -35,12 +40,15 @@ This repository implements a Node.js module for sending push notifications acros
35
40
-**Credentials:** Place service account keys and certificates in appropriate locations (see `README.md` for examples).
36
41
37
42
## Key Files & Directories
43
+
38
44
-`lib/` and `src/`: Main implementation (mirrored structure)
39
45
-`test/`: Test cases and sample credentials
40
46
-`README.md`: Usage, configuration, and data model reference
41
47
42
48
## Example Usage
49
+
43
50
See `README.md` for a full example of settings, registration ID formats, and sending notifications.
44
51
45
52
---
53
+
46
54
For unclear or incomplete sections, please provide feedback or specify which workflows, patterns, or integrations need further documentation.
0 commit comments