{"_id":"@abxy/tripwire-server","_rev":"6-97c00416329e2367c153bec947b36625","name":"@abxy/tripwire-server","dist-tags":{"latest":"0.2.3"},"versions":{"0.1.0":{"name":"@abxy/tripwire-server","version":"0.1.0","license":"MIT","_id":"@abxy/tripwire-server@0.1.0","maintainers":[{"name":"alain","email":"me@alainmeier.com"}],"homepage":"https://github.com/abxy-labs/tripwire-server-node#readme","bugs":{"url":"https://github.com/abxy-labs/tripwire-server-node/issues"},"dist":{"shasum":"785aa7cf69659e743671adbc12ad0c1e4da388f6","tarball":"https://registry.npmjs.org/@abxy/tripwire-server/-/tripwire-server-0.1.0.tgz","fileCount":30,"integrity":"sha512-X2quBU+CYFIRQe1oEgEJ+kKmQoHLY1aiCisvoJAXacgv7DkhaJMH9GOaonKkKOTgS7pWnf3C+u9LtDgGCUYP7Q==","signatures":[{"sig":"MEUCICuxb+nNuBb64eeyI7zefXgAoh33esB8LHo+VkWGTY7GAiEAmTw5aUV+oCE/Xi9EJ0KKpVDcm91X/o6XdRes+DVgxg4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":145974},"main":"./dist/index.cjs","type":"module","_from":"file:artifacts/abxy-tripwire-server-0.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"test":"vitest run tests/client.test.ts tests/contract.test.ts tests/sealed-token.test.ts","build":"tsup","check":"npm run typecheck && npm run test && npm run build && npm run test:packaging","test:live":"vitest run tests/live.test.ts","typecheck":"tsc --noEmit","test:packaging":"node ./scripts/check-packaging.mjs","check:spec-sync":"bash ./scripts/check-spec-sync.sh"},"_npmUser":{"name":"alain","email":"me@alainmeier.com"},"_resolved":"/home/runner/work/tripwire-server-node/tripwire-server-node/artifacts/abxy-tripwire-server-0.1.0.tgz","_integrity":"sha512-X2quBU+CYFIRQe1oEgEJ+kKmQoHLY1aiCisvoJAXacgv7DkhaJMH9GOaonKkKOTgS7pWnf3C+u9LtDgGCUYP7Q==","repository":{"url":"git+https://github.com/abxy-labs/tripwire-server-node.git","type":"git"},"_npmVersion":"10.8.2","description":"Official Tripwire Node server SDK","directories":{},"sideEffects":false,"_nodeVersion":"20.20.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^4.1.0","typescript":"^5.9.3","@types/node":"^24.6.1"},"_npmOperationalInternal":{"tmp":"tmp/tripwire-server_0.1.0_1774461365596_0.8495061432026083","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@abxy/tripwire-server","version":"0.1.1","license":"MIT","_id":"@abxy/tripwire-server@0.1.1","maintainers":[{"name":"alain","email":"me@alainmeier.com"}],"homepage":"https://github.com/abxy-labs/tripwire-server-node#readme","bugs":{"url":"https://github.com/abxy-labs/tripwire-server-node/issues"},"dist":{"shasum":"e0401fdd259a62a891217087b0d868b507690d77","tarball":"https://registry.npmjs.org/@abxy/tripwire-server/-/tripwire-server-0.1.1.tgz","fileCount":30,"integrity":"sha512-kZqNLw14bIAKTljB2cGGmAejb7wEyKQIe8gHVfUXC69lIrJ/KWP99V+KoBU8u2TbAcnZkuBOxYHpuwjvYmXdUQ==","signatures":[{"sig":"MEUCIF9T72Q4JDpbnOtlfjFC45MIGNPAPULY4Bz8e/FYFoZJAiEAyCkEB+v6XQZOa9AOpZv1V+yg9BW/1xxNfq9aLf9dfDg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@abxy%2ftripwire-server@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":145974},"main":"./dist/index.cjs","type":"module","_from":"file:artifacts/abxy-tripwire-server-0.1.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"test":"vitest run tests/client.test.ts tests/contract.test.ts tests/sealed-token.test.ts","build":"tsup","check":"npm run typecheck && npm run test && npm run build && npm run test:packaging","test:live":"vitest run tests/live.test.ts","typecheck":"tsc --noEmit","test:packaging":"node ./scripts/check-packaging.mjs","check:spec-sync":"bash ./scripts/check-spec-sync.sh"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:5a402786-0202-4d1d-b112-bb11a5d4add0"}},"_resolved":"/home/runner/work/tripwire-server-node/tripwire-server-node/artifacts/abxy-tripwire-server-0.1.1.tgz","_integrity":"sha512-kZqNLw14bIAKTljB2cGGmAejb7wEyKQIe8gHVfUXC69lIrJ/KWP99V+KoBU8u2TbAcnZkuBOxYHpuwjvYmXdUQ==","repository":{"url":"git+https://github.com/abxy-labs/tripwire-server-node.git","type":"git"},"_npmVersion":"11.9.0","description":"Official Tripwire Node server SDK","directories":{},"sideEffects":false,"_nodeVersion":"24.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^4.1.0","typescript":"^5.9.3","@types/node":"^24.6.1"},"_npmOperationalInternal":{"tmp":"tmp/tripwire-server_0.1.1_1774462048173_0.4263738029800781","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@abxy/tripwire-server","version":"0.1.2","license":"MIT","_id":"@abxy/tripwire-server@0.1.2","maintainers":[{"name":"alain","email":"me@alainmeier.com"}],"homepage":"https://github.com/abxy-labs/tripwire-server-node#readme","bugs":{"url":"https://github.com/abxy-labs/tripwire-server-node/issues"},"dist":{"shasum":"1784edab36f3c9408b7375bd4bf62c90c522a819","tarball":"https://registry.npmjs.org/@abxy/tripwire-server/-/tripwire-server-0.1.2.tgz","fileCount":30,"integrity":"sha512-tNvuK4A/Y32l38Za6kbIID3O5UGviR6WeUZQwyouklQS/wg5gX4GxMnSKq1ZskYh/RaR575m/4BX7AeoIH7Mjg==","signatures":[{"sig":"MEYCIQDrmsf57GIOKrdfClNc9Q/qGt0T+o2XitFYDJ3skrx+dwIhAIV2vOH+C+eX9LOwa0d7CLZaF1d+EEte7XpuDrz+W/V1","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@abxy%2ftripwire-server@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":146610},"main":"./dist/index.cjs","type":"module","_from":"file:artifacts/abxy-tripwire-server-0.1.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"test":"vitest run tests/client.test.ts tests/contract.test.ts tests/sealed-token.test.ts","build":"tsup","check":"npm run typecheck && npm run test && npm run build && npm run test:packaging","test:live":"vitest run tests/live.test.ts","typecheck":"tsc --noEmit","test:packaging":"node ./scripts/check-packaging.mjs","check:spec-sync":"bash ./scripts/check-spec-sync.sh"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:5a402786-0202-4d1d-b112-bb11a5d4add0"}},"_resolved":"/home/runner/work/tripwire-server-node/tripwire-server-node/artifacts/abxy-tripwire-server-0.1.2.tgz","_integrity":"sha512-tNvuK4A/Y32l38Za6kbIID3O5UGviR6WeUZQwyouklQS/wg5gX4GxMnSKq1ZskYh/RaR575m/4BX7AeoIH7Mjg==","repository":{"url":"git+https://github.com/abxy-labs/tripwire-server-node.git","type":"git"},"_npmVersion":"11.9.0","description":"Official Tripwire Node server SDK","directories":{},"sideEffects":false,"_nodeVersion":"24.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^4.1.0","typescript":"^5.9.3","@types/node":"^24.6.1"},"_npmOperationalInternal":{"tmp":"tmp/tripwire-server_0.1.2_1774470118620_0.694716640302411","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@abxy/tripwire-server","version":"0.2.1","license":"MIT","_id":"@abxy/tripwire-server@0.2.1","maintainers":[{"name":"alain","email":"me@alainmeier.com"}],"homepage":"https://github.com/abxy-labs/tripwire-server-node#readme","bugs":{"url":"https://github.com/abxy-labs/tripwire-server-node/issues"},"dist":{"shasum":"322d3de6d1116041a343f617c444034fea9bc51b","tarball":"https://registry.npmjs.org/@abxy/tripwire-server/-/tripwire-server-0.2.1.tgz","fileCount":50,"integrity":"sha512-RdOkd4j2h9nWN2EzphZdXV69GdTzc3yaWuVZ0hrJGGyALVenK/HezZhK4by0PaMNW6fKKlR7yLy6j2umRPpdFw==","signatures":[{"sig":"MEUCIQD8i9qbYaPASZj6ZIDXIjIJNiEWFUd7EKgS4gltEfZS6wIgRzF+bqTfNmc5XLOvubmYrYBkIzE5vh8zkQKEekM1Q4w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@abxy%2ftripwire-server@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":435635},"main":"./dist/index.cjs","type":"module","_from":"file:artifacts/abxy-tripwire-server-0.2.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"test":"vitest run tests/client.test.ts tests/contract.test.ts tests/sealed-token.test.ts tests/gate-delivery.test.ts","build":"tsup","check":"npm run typecheck && npm run test && npm run build && npm run test:packaging","test:live":"vitest run tests/live.test.ts","typecheck":"tsc --noEmit","test:packaging":"node ./scripts/check-packaging.mjs","check:spec-sync":"bash ./scripts/check-spec-sync.sh"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:5a402786-0202-4d1d-b112-bb11a5d4add0"}},"_resolved":"/home/runner/work/tripwire-server-node/tripwire-server-node/artifacts/abxy-tripwire-server-0.2.1.tgz","_integrity":"sha512-RdOkd4j2h9nWN2EzphZdXV69GdTzc3yaWuVZ0hrJGGyALVenK/HezZhK4by0PaMNW6fKKlR7yLy6j2umRPpdFw==","repository":{"url":"git+https://github.com/abxy-labs/tripwire-server-node.git","type":"git"},"_npmVersion":"11.11.0","description":"Official Tripwire Node server SDK","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^4.1.0","typescript":"^5.9.3","@types/node":"^24.6.1"},"_npmOperationalInternal":{"tmp":"tmp/tripwire-server_0.2.1_1775347346108_0.26503982125581427","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@abxy/tripwire-server","version":"0.2.2","license":"MIT","_id":"@abxy/tripwire-server@0.2.2","maintainers":[{"name":"alain","email":"me@alainmeier.com"}],"homepage":"https://github.com/abxy-labs/tripwire-server-node#readme","bugs":{"url":"https://github.com/abxy-labs/tripwire-server-node/issues"},"dist":{"shasum":"55d9547d02d6c5d6627189e90d746edd2c75bd84","tarball":"https://registry.npmjs.org/@abxy/tripwire-server/-/tripwire-server-0.2.2.tgz","fileCount":50,"integrity":"sha512-TXnlfdlQ6G22jAO6pmgZ8v9SDJDIVBZ+VKpeSHUByOduy/kv79aJ7lXJt34ZdgAHkBETn14QuuSJZKUTptjPow==","signatures":[{"sig":"MEYCIQCfA2WBYmqjP9SWN9IjrzDfUpf9fMeBdmkbZcKp6SU7gQIhAPCGQEMK41FlqD1Gxs0KL8j3jflOKx1X6t5FIqNabBKX","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@abxy%2ftripwire-server@0.2.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":754403},"main":"./dist/index.cjs","type":"module","_from":"file:artifacts/abxy-tripwire-server-0.2.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"test":"vitest run tests/client.test.ts tests/contract.test.ts tests/sealed-token.test.ts tests/gate-delivery.test.ts","build":"tsup","check":"npm run typecheck && npm run test && npm run build && npm run test:packaging","test:live":"vitest run tests/live.test.ts","typecheck":"tsc --noEmit","test:packaging":"node ./scripts/check-packaging.mjs","check:spec-sync":"bash ./scripts/check-spec-sync.sh"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:5a402786-0202-4d1d-b112-bb11a5d4add0"}},"_resolved":"/home/runner/work/tripwire-server-node/tripwire-server-node/artifacts/abxy-tripwire-server-0.2.2.tgz","_integrity":"sha512-TXnlfdlQ6G22jAO6pmgZ8v9SDJDIVBZ+VKpeSHUByOduy/kv79aJ7lXJt34ZdgAHkBETn14QuuSJZKUTptjPow==","repository":{"url":"git+https://github.com/abxy-labs/tripwire-server-node.git","type":"git"},"_npmVersion":"11.11.0","description":"Official Tripwire Node server SDK","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^4.1.0","typescript":"^5.9.3","@types/node":"^24.6.1"},"_npmOperationalInternal":{"tmp":"tmp/tripwire-server_0.2.2_1775850865250_0.1918966451480304","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"@abxy/tripwire-server","version":"0.2.3","description":"Official Tripwire Node server SDK","license":"MIT","repository":{"type":"git","url":"git+https://github.com/abxy-labs/tripwire-server-node.git"},"homepage":"https://github.com/abxy-labs/tripwire-server-node#readme","bugs":{"url":"https://github.com/abxy-labs/tripwire-server-node/issues"},"type":"module","sideEffects":false,"engines":{"node":">=18"},"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"publishConfig":{"access":"public"},"scripts":{"build":"tsup && tsc -p tsconfig.build.json","typecheck":"tsc --noEmit","test":"vitest run tests/client.test.ts tests/contract.test.ts tests/sealed-token.test.ts tests/gate-delivery.test.ts","test:live":"vitest run tests/live.test.ts","check:spec-sync":"bash ./scripts/check-spec-sync.sh","test:packaging":"node ./scripts/check-packaging.mjs","check":"npm run typecheck && npm run test && npm run build && npm run test:packaging"},"devDependencies":{"@types/node":"^24.6.1","tsup":"^8.5.0","typescript":"^6.0.3","vitest":"^4.1.0"},"_id":"@abxy/tripwire-server@0.2.3","_integrity":"sha512-pvzra88nsNziN93hrUPeXn3a8Y8P4fESlRqJ5VlGhZ1o771WXKQAgPEDis2g/l9CC2wZd0Hbzti4CWEItpKrGA==","_resolved":"/home/runner/work/tripwire-server-node/tripwire-server-node/artifacts/abxy-tripwire-server-0.2.3.tgz","_from":"file:artifacts/abxy-tripwire-server-0.2.3.tgz","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-pvzra88nsNziN93hrUPeXn3a8Y8P4fESlRqJ5VlGhZ1o771WXKQAgPEDis2g/l9CC2wZd0Hbzti4CWEItpKrGA==","shasum":"2aafb9573d37ad54593bfe63a07a2a692e3a4ef9","tarball":"https://registry.npmjs.org/@abxy/tripwire-server/-/tripwire-server-0.2.3.tgz","fileCount":55,"unpackedSize":989030,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@abxy%2ftripwire-server@0.2.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDZPRhG8tmgjKNz01y8Vf6mWr4vZZQttu4URL2iofdDiQIgUtiJS0IMe2dpQHLCd/LiIJMeGoPVo0NEo4c7GInaLzw="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:5a402786-0202-4d1d-b112-bb11a5d4add0"}},"directories":{},"maintainers":[{"name":"alain","email":"me@alainmeier.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tripwire-server_0.2.3_1778780917216_0.10038221701534278"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-25T17:56:05.484Z","modified":"2026-05-14T17:48:37.663Z","0.1.0":"2026-03-25T17:56:05.750Z","0.1.1":"2026-03-25T18:07:28.336Z","0.1.2":"2026-03-25T20:21:58.778Z","0.2.1":"2026-04-05T00:02:26.266Z","0.2.2":"2026-04-10T19:54:25.390Z","0.2.3":"2026-05-14T17:48:37.385Z"},"bugs":{"url":"https://github.com/abxy-labs/tripwire-server-node/issues"},"license":"MIT","homepage":"https://github.com/abxy-labs/tripwire-server-node#readme","repository":{"type":"git","url":"git+https://github.com/abxy-labs/tripwire-server-node.git"},"description":"Official Tripwire Node server SDK","maintainers":[{"name":"alain","email":"me@alainmeier.com"}],"readme":"# Tripwire Node Library\n\n![Preview](https://img.shields.io/badge/status-preview-111827)\n![Node 18+](https://img.shields.io/badge/node-%E2%89%A518-339933?logo=node.js&logoColor=white)\n![License: MIT](https://img.shields.io/badge/license-MIT-0f766e.svg)\n\nThe Tripwire Node library provides convenient access to the Tripwire API from applications running in Node.js. It includes a typed client for Sessions, Fingerprints, Organizations, organization API key management, sealed token verification, Gate, and Gate delivery/webhook helpers.\n\nThe library also provides:\n\n- a fast configuration path using `TRIPWIRE_SECRET_KEY`\n- helpers for cursor-based pagination\n- structured API errors and built-in sealed token verification\n- webhook endpoint management, test sends, and event delivery history\n- public, bearer-token, and secret-key auth modes for Gate flows\n- Gate delivery/webhook helpers\n\n## Documentation\n\nSee the [Tripwire docs](https://tripwirejs.com/docs) and [API reference](https://tripwirejs.com/docs/api-reference/introduction).\n\n## Installation\n\nYou don't need this source code unless you want to modify the package. If you just want to use the package, run:\n\n```bash\nnpm install @abxy/tripwire-server\n```\n\n## Requirements\n\n- Node 18+\n\n## Usage\n\nUse `TRIPWIRE_SECRET_KEY` or an explicit `secretKey` for core detect APIs. For public or bearer-auth Gate flows, the client can also be constructed without a secret key:\n\n```ts\nimport { Tripwire } from \"@abxy/tripwire-server\";\n\nconst client = new Tripwire({\n  secretKey: process.env.TRIPWIRE_SECRET_KEY,\n});\n\nconst page = await client.sessions.list({ verdict: \"bot\", limit: 25 });\nconst session = await client.sessions.get(\"sid_123\");\n\nconsole.log(page.has_more, page.next_cursor);\nconsole.log(session.decision.risk_score, session.highlights[0]?.summary);\n```\n\n### Sealed token verification\n\n```ts\nimport { safeVerifyTripwireToken } from \"@abxy/tripwire-server\";\n\nconst result = safeVerifyTripwireToken(\n  sealedToken,\n  process.env.TRIPWIRE_SECRET_KEY,\n);\n\nif (!result.ok) {\n  console.error(result.error);\n  return;\n}\n\nconsole.log(result.data.decision.verdict, result.data.decision.risk_score);\n```\n\n### Pagination\n\n```ts\nfor await (const session of client.sessions.iter({ search: \"signup\" })) {\n  console.log(session.id, session.latest_decision.verdict);\n}\n```\n\n### Fingerprints\n\n```ts\nconst page = await client.fingerprints.list({ sort: \"seen_count\" });\nconst fingerprint = await client.fingerprints.get(\"vid_123\");\n\nconsole.log(fingerprint.lifecycle.last_seen_at);\n```\n\n### Organizations\n\n```ts\nconst organization = await client.organizations.get(\"org_123\");\nconst updated = await client.organizations.update(\"org_123\", { name: \"New Name\" });\n```\n\n### Organization API keys\n\n```ts\nconst created = await client.organizations.apiKeys.create(\"org_123\", {\n  name: \"Production\",\n  type: \"secret\",\n  environment: \"live\",\n  scopes: [\"sessions:list\", \"sessions:read\"],\n});\n\nawait client.organizations.apiKeys.revoke(\"org_123\", created.id);\n```\n\n### Webhooks\n\n```ts\nconst endpoint = await client.webhooks.createEndpoint(\"org_123\", {\n  name: \"Production alerts\",\n  url: \"https://example.com/tripwire/webhook\",\n  event_types: [\"session.result.persisted\", \"gate.session.approved\"],\n});\n\nconst events = await client.webhooks.listEvents(\"org_123\", {\n  endpoint_id: endpoint.id,\n  type: \"session.result.persisted\",\n});\n\nconsole.log(events.items[0]?.webhook_deliveries[0]?.status);\n```\n\n### Gate APIs\n\n```ts\nconst client = new Tripwire();\n\nconst services = await client.gate.registry.list();\nconst session = await client.gate.sessions.create({\n  service_id: \"tripwire\",\n  account_name: \"my-project\",\n  delivery: createDeliveryKeyPair().delivery,\n});\n\nconsole.log(services[0]?.id, session.consent_url);\n```\n\n### Gate delivery and webhook helpers\n\n```ts\nimport {\n  createDeliveryKeyPair,\n  createGateApprovedWebhookResponse,\n  decryptGateDeliveryEnvelope,\n  verifyGateWebhookSignature,\n} from \"@abxy/tripwire-server\";\n\nconst keyPair = createDeliveryKeyPair();\nconst response = createGateApprovedWebhookResponse({\n  delivery: keyPair.delivery,\n  outputs: {\n    TRIPWIRE_PUBLISHABLE_KEY: \"pk_live_...\",\n    TRIPWIRE_SECRET_KEY: \"sk_live_...\",\n  },\n});\n\nconst payload = decryptGateDeliveryEnvelope(keyPair.privateKey, response.encrypted_delivery);\nconsole.log(payload.outputs.TRIPWIRE_SECRET_KEY);\n\nconsole.log(verifyGateWebhookSignature({\n  secret: \"whsec_test\",\n  timestamp: \"1735776000\",\n  rawBody: \"{\\\"event\\\":\\\"gate.session.approved\\\"}\",\n  signature: \"…\",\n}));\n```\n\n### Error handling\n\n```ts\nimport { TripwireApiError } from \"@abxy/tripwire-server\";\n\ntry {\n  await client.sessions.list({ limit: 999 });\n} catch (error) {\n  if (error instanceof TripwireApiError) {\n    console.error(error.status, error.code, error.message);\n  }\n}\n```\n\n## Support\n\nIf you need help integrating Tripwire, start with [tripwirejs.com/docs](https://tripwirejs.com/docs).\n","readmeFilename":"README.md"}