Official TypeScript SDK for the WWSrapport API.
- API overview and Swagger: wwsrapport.nl/api/docs
- OpenAPI JSON: wwsrapport.nl/api/openapi.json
- Request a partner account: wwsrapport.nl/api/toegang-aanvragen
- WWSrapport account and API keys: wwsrapport.nl/account
- GitHub organization: github.com/wwsrapport
Official clients:
pnpm add @wwsrapport/clientimport { WwsrapportClient, type ReportResponse } from '@wwsrapport/client';
const client = new WwsrapportClient({
apiKey: process.env.WWSRAPPORT_API_KEY!,
});
const report: ReportResponse = await client.reports.create(
{
address: {
postcode: '3905RB',
house_number: '4',
city: 'Veenendaal',
},
customer_reference: 'demo-001',
},
'demo-001'
);
console.log(report.id, report.status);The SDK exports TypeScript types for the public API contract, including:
- property prefill responses;
- report creation, listing and calculation responses;
- improvement advice responses;
- document lists;
- usage and rulesets;
- webhook endpoints and delivery attempts.
The runtime response stays the exact JSON returned by the API, while TypeScript gets safer autocompletion and compile-time checks.
import { verifyWebhookSignature, parseWebhookEvent } from '@wwsrapport/client';
const rawBody = await request.text();
const isValid = await verifyWebhookSignature(rawBody, request.headers, process.env.WWSRAPPORT_WEBHOOK_SECRET!);
if (!isValid) {
throw new Error('Invalid webhook signature');
}
const event = parseWebhookEvent(rawBody);
console.log(event.type, event.data);The verifier expects the WWSrapport headers:
WWS-Webhook-TimestampWWS-Webhook-Signature
The signature format is v1=<hex-hmac-sha256>, signed over:
{timestamp}.{raw_body}
pnpm install
pnpm test