Why Use an SDK?
The Cred Evaluation API returns a trust score, trust tier, per-gate breakdown, and optional dynamic pricing for any wallet address. You can call it directly withfetch or httpx, but the SDK packages give you:
- Typed responses — full TypeScript types and Python dataclasses, no parsing raw JSON
- Framework middleware — one line to gate every route with trust checks
- Automatic 402/403 handling — challenges and denials built in
- Trust headers —
X-Cred-Trust-ScoreandX-Cred-Trust-Tierset on every response - Dynamic pricing — trust-score-based price multipliers computed server-side
Available Packages
TypeScript SDK
Core client for Node.js, Deno, Bun, and edge runtimes. Zero dependencies beyond
fetch.Hono Middleware
Drop-in middleware for Hono. One line to trust-gate your API.
Express Middleware
Express middleware with
req.credTrust for downstream handlers.Next.js Middleware
Next.js proxy (16+) or middleware (14 and 15) with route matching.
Python SDK
Async client and FastAPI
Depends() integration.Installation
How It Works
Every SDK package calls the same backend endpoint:
The middleware packages wrap this into framework-native patterns — Hono
c.set(), Express req.credTrust, Next.js response headers, FastAPI Depends().
Trust Tiers
Policy Templates
Instead of configuring individual gates, use a named policy template:Getting Your API Key
The same API key works for both the Credit Scoring API (api.credprotocol.com) and the Trust Evaluation API (validator.credprotocol.com). One key, every Cred service.
1
Sign up at app.credprotocol.com
Go to app.credprotocol.com and create an account.
2
Create an API key
Navigate to API Keys in the dashboard and click Create API Key. Copy the key — it is shown exactly once.
3
Set it as an environment variable
Your API key works across all Cred endpoints — credit scores, reports, identity attestations, and trust evaluation. No separate keys needed.
Next Steps
Pick the package that matches your stack and follow the integration guide:- TypeScript SDK — if you want full control
- Hono Middleware — fastest path for Hono/Cloudflare Workers
- Express Middleware — for Express/Node.js APIs
- Next.js — for a Next.js proxy (16+) or middleware (14 and 15)
- Python SDK — for Python/FastAPI services