DATABASE_URL is configured, the backend can store rebuildable analytics aggregates, partner records, app records, API-key hashes, webhook registrations, protected invoices, and delivery state.
New integrations should start with the modern /api/partner/v1/* API and packages/coverfi-sdk. The older /api/partners/* API and partner-sdk are retained for compatibility while the partner surface is consolidated.
Enable the database
DATABASE_URLDATABASE_SSL=truewhen the provider requires TLSPARTNER_ADMIN_WALLETSPARTNER_API_KEY_PEPPER
Privacy rules
- Analytics tables must not store raw wallet addresses.
- Wallet identifiers use HMAC references.
- Aggregate metrics include a
cohort_suppressedflag for small cohorts. - Analytics are non-authoritative and rebuildable from public ledger data.
- Do not join analytics with support messages, AI text, receipt private content, IP addresses, or browser identifiers.
Admin endpoints
Admin endpoints require a wallet-authenticated session from a wallet listed inPARTNER_ADMIN_WALLETS.
GET /api/partners/adminPOST /api/partners/adminPATCH /api/partners/admin/:partnerId/statusPOST /api/partners/admin/:partnerId/api-keys
Modern partner API endpoints
Modern partner endpoints requireAuthorization: Bearer <partner-api-key> or a partner session token where supported.
POST /api/partner/v1/protection/quotesPOST /api/partner/v1/protection/positionsGET /api/partner/v1/protection/positionsGET /api/partner/v1/assetsGET /api/partner/v1/pricingGET /api/partner/v1/usageGET /api/partner/v1/claimsGET /api/partner/v1/payoutsGET /api/partner/v1/receiptsGET /api/partner/v1/webhooksPOST /api/partner/v1/webhooksGET /api/partner/v1/wallets/signing-payloads/:positionIdPOST /api/partner/v1/wallets/signing-payloads/:positionId/submit
packages/coverfi-sdk.
Legacy partner API endpoints
Partner endpoints requireAuthorization: Bearer <partner-api-key>.
GET /api/partners/market-configPOST /api/partners/quotePOST /api/partners/transaction-drafts/protectionGET /api/partners/metricsPOST /api/partners/webhooksPOST /api/partners/webhooks/test
Legacy TypeScript SDK
The repository includes a legacy Testnet SDK atpartner-sdk.
CoverFiPartnerClientfor market configuration, quotes, unsigned protection transaction drafts, metrics, webhook registration, and webhook tests.verifyCoverFiWebhookfor HMAC webhook verification.- Typed quote, draft, metrics, and webhook event models.
Webhook events
Supported event names:position.createdposition.awaiting_oracleposition.settledpayout.claimedprincipal.withdrawnreserve.utilization_changedoracle.staleoracle.recovered
webhook_deliveries for retry and dead-letter state. The server/scripts/webhook-worker.js worker delivers signed events and records retry or dead-letter status.
Production hardening still needs strict webhook URL validation, unified SDK verification format, partner idempotency enforcement, and per-key rate limits before broad partner launch.