@hnnp/sdk 0.1.1 → 0.1.4

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.
Files changed (2) hide show
  1. package/README.md +46 -46
  2. package/package.json +2 -1
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
- # HNNP Node.js SDK
2
-
1
+ # HNNP Node.js SDK
2
+
3
3
  This directory contains the official Node.js SDK for interacting with the HNNP Cloud backend.
4
4
  It implements REST API wrappers and webhook verification logic exactly as defined in the protocol specification.
5
5
 
6
6
  All SDK behavior MUST follow: protocol/spec.md
7
-
8
- ---
9
-
7
+
8
+ ---
9
+
10
10
  ## Features
11
11
 
12
12
  - Typed API client (TypeScript)
@@ -14,19 +14,19 @@ All SDK behavior MUST follow: protocol/spec.md
14
14
  - Webhook signature verification
15
15
  - Pagination helpers
16
16
  - Error handling & retry wrappers
17
-
18
- ---
19
-
20
- ## Installation
21
-
22
- npm install @hnnp/sdk
23
-
24
- ---
25
-
26
- ## Usage Example
27
-
28
- import { HnnpClient } from "@hnnp/sdk";
29
-
17
+
18
+ ---
19
+
20
+ ## Installation
21
+
22
+ npm install @hnnp/sdk
23
+
24
+ ---
25
+
26
+ ## Usage Example
27
+
28
+ import { HnnpClient } from "@hnnp/sdk";
29
+
30
30
  const client = new HnnpClient({
31
31
  apiKey: "YOUR_API_KEY",
32
32
  baseUrl: "https://api.hnnp.example"
@@ -44,16 +44,16 @@ await client.linkPresenceSession({
44
44
  userRef: "emp_45",
45
45
  orgId: "org_123"
46
46
  });
47
-
48
- ---
49
-
47
+
48
+ ---
49
+
50
50
  ## Webhook Verification
51
51
 
52
52
  import { verifyHnnpWebhook } from "@hnnp/sdk";
53
-
54
- const isValid = verifyHnnpWebhook({
55
- rawBody,
56
- signature: headers["x-hnnp-signature"],
53
+
54
+ const isValid = verifyHnnpWebhook({
55
+ rawBody,
56
+ signature: headers["x-hnnp-signature"],
57
57
  timestamp: headers["x-hnnp-timestamp"],
58
58
  webhookSecret: process.env.WEBHOOK_SECRET
59
59
  });
@@ -91,7 +91,7 @@ app.post("/hnnp/webhook", (req, res) => {
91
91
  ```
92
92
 
93
93
  ---
94
-
94
+
95
95
  ## Available Methods
96
96
 
97
97
  Receivers
@@ -159,26 +159,26 @@ Incidents + safety
159
159
  - getIncidentRollcall({ incidentId })
160
160
  - getSafetyStatus()
161
161
  - getSafetySummary()
162
-
163
- ---
164
-
165
- ## File Structure
166
-
167
- src/
168
- index.ts
169
- client.ts
170
- http.ts
171
- webhook.ts
172
- types.ts
173
-
174
- ---
175
-
176
- ## Environment Variables
177
-
178
- WEBHOOK_SECRET=your_org_webhook_secret
179
-
180
- ---
181
-
162
+
163
+ ---
164
+
165
+ ## File Structure
166
+
167
+ src/
168
+ index.ts
169
+ client.ts
170
+ http.ts
171
+ webhook.ts
172
+ types.ts
173
+
174
+ ---
175
+
176
+ ## Environment Variables
177
+
178
+ WEBHOOK_SECRET=your_org_webhook_secret
179
+
180
+ ---
181
+
182
182
  ## Notes
183
183
 
184
184
  - Webhook signing follows the HMAC rules in Section 10.3 of the v2 spec.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hnnp/sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.4",
4
4
  "private": false,
5
5
  "description": "HNNP Node.js SDK",
6
6
  "license": "UNLICENSED",
@@ -28,6 +28,7 @@
28
28
  "prepublishOnly": "npm run build"
29
29
  },
30
30
  "devDependencies": {
31
+ "@types/node": "^20.11.30",
31
32
  "typescript": "^5.5.0",
32
33
  "vitest": "^2.1.0"
33
34
  },