@owlmetry/node 0.1.0 → 0.1.2
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 +46 -0
- package/package.json +8 -7
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# @owlmetry/node
|
|
2
|
+
|
|
3
|
+
Node.js SDK for [OwlMetry](https://owlmetry.com) — self-hosted metrics tracking for mobile and backend apps.
|
|
4
|
+
|
|
5
|
+
Zero runtime dependencies. Works with any Node.js framework.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @owlmetry/node
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import OwlMetry from "@owlmetry/node";
|
|
17
|
+
|
|
18
|
+
OwlMetry.configure({
|
|
19
|
+
clientKey: "owl_client_...",
|
|
20
|
+
endpoint: "https://ingest.owlmetry.com",
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Log events
|
|
24
|
+
OwlMetry.info("User signed up", { screen: "onboarding" });
|
|
25
|
+
OwlMetry.error("Payment failed", { orderId: "abc123" });
|
|
26
|
+
|
|
27
|
+
// Track metrics
|
|
28
|
+
const op = OwlMetry.startOperation("api-request");
|
|
29
|
+
// ... do work ...
|
|
30
|
+
op.complete({ route: "/users" });
|
|
31
|
+
|
|
32
|
+
// Track funnels
|
|
33
|
+
OwlMetry.track("signup-started");
|
|
34
|
+
|
|
35
|
+
// Serverless support
|
|
36
|
+
export default OwlMetry.wrapHandler(async (req, res) => {
|
|
37
|
+
OwlMetry.info("Request received");
|
|
38
|
+
res.json({ ok: true });
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Links
|
|
43
|
+
|
|
44
|
+
- [Website](https://owlmetry.com)
|
|
45
|
+
- [GitHub](https://github.com/Jasonvdb/owlmetry)
|
|
46
|
+
- [CLI with AI skills](https://www.npmjs.com/package/@owlmetry/cli) — install the CLI and run `owlmetry skills` to get AI agent skill files
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmetry/node",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "OwlMetry Node.js Server SDK",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
6
|
+
"main": "dist/src/index.js",
|
|
7
|
+
"types": "dist/src/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"import": "./dist/index.js",
|
|
11
|
-
"types": "./dist/index.d.ts"
|
|
10
|
+
"import": "./dist/src/index.js",
|
|
11
|
+
"types": "./dist/src/index.d.ts"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build": "tsc",
|
|
19
19
|
"test": "node --test tests/unit/*.test.js",
|
|
20
|
-
"test:integration": "node --test tests/integration/*.test.js"
|
|
20
|
+
"test:integration": "node --test tests/integration/*.test.js",
|
|
21
|
+
"prepublishOnly": "npm run build"
|
|
21
22
|
},
|
|
22
23
|
"engines": {
|
|
23
24
|
"node": ">=20"
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
"license": "MIT",
|
|
26
27
|
"repository": {
|
|
27
28
|
"type": "git",
|
|
28
|
-
"url": "https://github.com/Jasonvdb/owlmetry.git",
|
|
29
|
+
"url": "git+https://github.com/Jasonvdb/owlmetry.git",
|
|
29
30
|
"directory": "sdks/node"
|
|
30
31
|
},
|
|
31
32
|
"homepage": "https://owlmetry.com",
|