@hellsoft/vaka-node 0.0.0-stage → 0.2.0

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 CHANGED
@@ -1,3 +1,25 @@
1
- # Temporary Holding Version
1
+ # @hellsoft/vaka-node
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Node.js SDK for [Vaka](https://github.com/ErikHellman/vaka): crash and error reporting,
4
+ OpenTelemetry traces and logs, breadcrumbs, release tagging and feature flags.
5
+
6
+ ```sh
7
+ npm install @hellsoft/vaka-node
8
+ VAKA_KEY=vk_... VAKA_ENDPOINT=https://vaka.example.com VAKA_RELEASE=1.0.0 \
9
+ node --import @hellsoft/vaka-node/register server.js
10
+ ```
11
+
12
+ ```ts
13
+ import * as Vaka from '@hellsoft/vaka-node';
14
+
15
+ app.use(Vaka.requestHandler()); // Express: per-request scope
16
+ // routes
17
+ app.use(Vaka.errorHandler()); // report 5xx errors
18
+
19
+ Vaka.setUser(req.user.id);
20
+ if (await Vaka.isEnabled('new_checkout')) { /* ... */ }
21
+ Vaka.captureException(err);
22
+ ```
23
+
24
+ Docs: [SDK reference](https://vaka.hellsoft.se/sdk-node.html) ·
25
+ [install guide](https://vaka.hellsoft.se/install/node.html). License: MIT OR Apache-2.0.