node/README.md
2026-04-25 12:02:34 +02:00

145 lines
4.5 KiB
Markdown

# hightrusted CAPTURE — Node.js SDK
> **Status:** v0.1 Preview — API stabil, SDK in aktiver Entwicklung
Offizielles Node.js-SDK für die [hightrusted CAPTURE API](https://capture.hightrusted.net) —
forensische Web-Captures mit qualifiziertem Zeitstempel nach RFC 3161 / eIDAS Art. 41.
**Made in Germany.** Server in Deutschland. DSGVO-nativ. Kein US-Cloud-Anbieter
in der Verarbeitungskette. Quelloffen unter MIT-Lizenz.
## Was die CAPTURE API tut
Sie nimmt eine URL entgegen, rendert die Seite vollständig (inkl. JavaScript),
liefert sie als PDF/A zurück und versieht das Ergebnis mit einem qualifizierten
Zeitstempel. Das Ergebnis ist gerichtsverwertbar und Jahre später noch
verifizierbar — auch nachdem die Original-Seite längst offline ist.
Anwendungsfälle: Markenrechtsverletzungen dokumentieren, Auftragsbedingungen
zum Buchungszeitpunkt sichern, Compliance-Nachweise für Behörden, Beweissicherung
durch Anwälte und Sachverständige.
## Installation
```bash
npm install @hightrusted/capture
```
## Quickstart
```javascript
import { Client } from '@hightrusted/capture';
const client = new Client({ apiKey: 'ht_live_...' });
// Synchron — wartet bis zu 30 s auf das fertige PDF
const capture = await client.capture({ url: 'https://example.com' });
console.log(capture.id);
console.log(capture.verifyUrl);
console.log(capture.timestamp.issuedAt);
// PDF herunterladen
await capture.download('./beweis.pdf');
```
## Authentifizierung
Bearer-Token mit API-Key. Key-Erzeugung im Dashboard:
https://capture.hightrusted.net/dashboard/api-keys
```javascript
// API-Key direkt
const client = new Client({ apiKey: 'ht_live_...' });
// oder über Umgebungsvariable HIGHTRUSTED_API_KEY
const client = new Client();
```
## Asynchrone Captures + Webhooks
```javascript
const job = await client.captureAsync({
url: 'https://example.com',
webhookUrl: 'https://your-app.tld/webhooks/capture',
});
// job.status === 'queued'
// später, sobald der Webhook capture.ready geliefert hat:
const capture = await client.get(job.id);
await capture.download('./beweis.pdf');
```
## Verify
```javascript
const result = await client.verify('cap_...');
console.log(result.valid); // true
console.log(result.timestamp); // 2026-04-25T11:29:40Z
```
## Rate Limits
Limits werden pro API-Key gemessen. Bei Überschreitung: HTTP 429 mit
`Retry-After`-Header. Das SDK respektiert den Header automatisch und retried.
| Plan | req/min | Calls/Monat |
|-----------|---------|-------------|
| Developer | 5 | 100 |
| Starter | 30 | 300 |
| Growth | 120 | 2.000 |
| Scale | 600 | 10.000 |
## Voraussetzungen
- Node.js 18 oder höher
- ESM und CommonJS werden beide unterstützt
- TypeScript-Typdefinitionen sind enthalten
## Entwicklung
```bash
git clone ssh://git@git.hightrusted.net:2222/hightrusted-capture/node.git
cd node
npm install
npm test
```
## Roadmap
- [ ] v0.1 — Basis-Client (Promise-API), Verify, Download
- [ ] v0.2 — Retry-Logik, Webhook-Signatur-Verifikation, vollständige TypeScript-Defs
- [ ] v0.3 — Stream-API für große PDFs
- [ ] v1.0 — Stabile API, semantische Versionierung
## Verwandte Repositorys
**Im selben Produkt** ([`hightrusted-capture`](https://git.hightrusted.net/hightrusted-capture)):
- [`openapi`](https://git.hightrusted.net/hightrusted-capture/openapi) — OpenAPI 3.1 Spec (Single Source of Truth)
- [`postman`](https://git.hightrusted.net/hightrusted-capture/postman) — Postman Collection
- [`examples`](https://git.hightrusted.net/hightrusted-capture/examples) — Beispiel-Anwendungen
- [`python`](https://git.hightrusted.net/hightrusted-capture/python) — Python-SDK
- [`php`](https://git.hightrusted.net/hightrusted-capture/php) — PHP-SDK
**Plattform-übergreifend** ([`hightrusted`](https://git.hightrusted.net/hightrusted)):
- [`platform`](https://git.hightrusted.net/hightrusted/platform) — Plattform-Übersicht, Architektur, Produkt-Liste
- [`developer-portal`](https://git.hightrusted.net/hightrusted/developer-portal) — gemeinsame Konventionen, Auth, Errors, Rate-Limits
- [`compliance`](https://git.hightrusted.net/hightrusted/compliance) — DSGVO, AGB-Templates, Whitepaper
## Support
- **Doku:** https://capture.hightrusted.net/api/docs
- **Status-Page:** https://status.hightrusted.net
- **Developer Support:** developers@hightrusted.net
- **Sicherheitslücken:** siehe [SECURITY.md](./SECURITY.md)
## Lizenz
MIT — siehe [LICENSE](./LICENSE).
---
**hightrusted GmbH***The European Trust Infrastructure.*
Made in Germany. DSGVO-nativ. eIDAS-konform.