Skip to main content
Production-ready code patterns for integrating Truthlocks into your applications. Examples are shown in TypeScript, Go, and Python.

JavaScript SDK

JavaScript SDK →

Go SDK

Go SDK →

Python SDK

Python SDK →

End-to-End: Issue and Verify a Credential

Complete workflow from creating an issuer to minting and verifying an attestation.

Revoke and supersede an attestation

Revoke a credential when it’s no longer valid, or supersede it with an updated version to preserve the audit trail.
Revocation is permanent and cannot be undone. If you need to issue an updated credential, use supersede instead — it preserves the original in the transparency log while linking to the replacement.

Batch minting with rate limiting

Mint credentials for multiple recipients in a single workflow with configurable concurrency and per-recipient success/failure reporting. Each recipient is processed independently — a failure for one does not block the others.
Set concurrency to match your plan’s rate limit. Start with 10 for Starter plans and increase to 50 or higher on Business and Enterprise tiers. Each failed recipient includes a descriptive error so you can retry selectively.

Query audit logs

Retrieve and filter audit events for security monitoring and compliance reporting.
Use resource_type and action filters to scope queries. For long-term archival, schedule periodic exports and store them in your own infrastructure. See audit logs for retention tiers and SIEM integration options.

Governance workflow

Create a multi-party approval workflow to manage issuer lifecycle changes such as suspend, revoke, and reinstate.
Governance requests require different permissions at each step. Creating requests needs governance:create, approving needs governance:approve, and executing needs governance:execute. See RBAC for role configuration.

Webhook Signature Verification

Securely verify incoming webhooks from Truthlocks to ensure they haven’t been tampered with.
webhook-handler.ts

Caching Verification Results

Cache verification results to reduce API calls. Only cache VALID results — revocations should always be checked fresh.
cached-verify.ts

Document Attestation with SHA-256

Attest a PDF document by computing its SHA-256 hash and including it in the claims for integrity verification.

Next Steps

Mint API reference

Full API docs with 35 credential schemas and interactive playground.

JavaScript SDK

Installation, authentication, and full method reference.

Go SDK

Idiomatic Go with context propagation and typed structs.

Python SDK

Python SDK with async support and type hints.

Rate limits

Understand quotas and retry strategies for production.

Revoke API reference

Permanently invalidate an attestation.

Supersede API reference

Replace an attestation with an updated version.