nixflex 0.2.0 → 0.2.1

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 (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +37 -0
  3. package/package.json +13 -7
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nixflex
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -75,6 +75,43 @@ try {
75
75
  - **Timeouts + AbortSignal support** per client or per request
76
76
  - **Zero runtime dependencies** — native fetch, Node 18+
77
77
 
78
+ ## Verifying webhooks
79
+
80
+ Nixflex signs every webhook delivery with an `X-Nixflex-Signature` header. Verify it before trusting a payload — pass the **raw** request body, not a re-serialized object:
81
+
82
+ ```js
83
+ import express from 'express';
84
+ import { verifyWebhookSignature } from 'nixflex';
85
+
86
+ const app = express();
87
+
88
+ app.post('/nixflex/calls', express.raw({ type: 'application/json' }), (req, res) => {
89
+ const ok = verifyWebhookSignature(
90
+ req.body, // raw Buffer
91
+ req.get('x-nixflex-signature'),
92
+ process.env.NIXFLEX_KEY_SECRET // the nxfs_... half of your key
93
+ );
94
+ if (!ok) return res.sendStatus(400);
95
+
96
+ const event = JSON.parse(req.body.toString('utf8'));
97
+ // handle event.event === 'call.completed'
98
+ res.sendStatus(200);
99
+ });
100
+ ```
101
+
102
+ Returns `false` for a tampered body, wrong secret, malformed header, or a signature older than the tolerance window (300 seconds; override with `{ toleranceSeconds }`). It never throws.
103
+
104
+ ## Deleting call data
105
+
106
+ ```js
107
+ await client.calls.delete(callId); // one call: record, transcript, recording
108
+ await client.calls.deleteAll(); // everything on the key
109
+ ```
110
+
111
+ Both are immediate and irreversible — fetch anything you need to keep first.
112
+
78
113
  ## Docs
79
114
 
80
115
  Full API reference: **https://docs.nixflex.com**
116
+
117
+ Release history: [CHANGELOG.md](CHANGELOG.md). Licensed under [MIT](LICENSE).
package/package.json CHANGED
@@ -1,17 +1,22 @@
1
1
  {
2
2
  "name": "nixflex",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Official Node.js SDK for the Nixflex voice AI platform - AI phone agents, outbound campaigns, and SMS.",
5
5
  "keywords": [
6
6
  "nixflex",
7
- "voice ai",
8
- "ai phone agent",
7
+ "voice-ai",
8
+ "voice-agent",
9
+ "phone",
9
10
  "telephony",
11
+ "ai-receptionist",
12
+ "twilio",
13
+ "telnyx",
10
14
  "sms",
11
- "voice agent",
12
- "ai calls"
15
+ "speech",
16
+ "api-client",
17
+ "sdk"
13
18
  ],
14
- "homepage": "https://docs.nixflex.com",
19
+ "homepage": "https://github.com/nixflex/nixflex-node#readme",
15
20
  "bugs": {
16
21
  "url": "https://github.com/nixflex/nixflex-node/issues"
17
22
  },
@@ -48,5 +53,6 @@
48
53
  "@types/node": "^26.2.0",
49
54
  "tsup": "^8.0.0",
50
55
  "typescript": "^5.4.0"
51
- }
56
+ },
57
+ "author": "Nixflex"
52
58
  }