Developers · SDKs & libraries

SDKs & libraries

Two ways to build: drop the embed SDK into an end-customer app for cards, payments and statements with zero backend work — or call the REST API directly and generate a typed client from our OpenAPI document.

Embed SDK Available now

A single script that mounts a themed, iframe-isolated widget into any page. It's what our own vertical apps use to render cardholder, activity, statement and send experiences — branded per tenant, no card data ever touching your servers.

Drop it in

<script src="https://api.digitaltreasury.com/sdk/dt.js"></script>
<div id="dt"></div>
<script>
  const widget = DigitalTreasury.mount('#dt', {
    app:   'send',        // card | activity | statement | send …
    token: '<session token>',
    theme: { accent: '#16a34a', brand: 'Acme Pay' },
    onEvent: e => console.log('dt', e)
  });
</script>

What it handles for you

Iframe isolation with CSP frame-ancestors pinned to your origin, per-tenant theming pulled from branding, PCI-safe card reveal, and a postMessage event relay to your onEvent handler. Call widget.destroy() to unmount.

Apps: card, activity, statement, login, onboard, send, dashboard.

OpenAPI document Available now

The entire /v1 surface is described by an OpenAPI 3 document. Point any generator at it for a typed client in the language of your choice, or explore it in your favourite API tool.

Generate a client

# the document
https://api.digitaltreasury.com/openapi/v1.json

# e.g. a TypeScript client
npx openapi-typescript \
  https://api.digitaltreasury.com/openapi/v1.json \
  -o dt.d.ts

Or just call it

# Python
import requests
r = requests.post(url + "/v1/payment-orders",
  headers={"X-API-Key": key,
           "Idempotency-Key": "inv_1"},
  json=order)

Official client libraries

Because the API ships an OpenAPI document, you can generate a typed client in any language its tooling supports today. Hand-written, idempotency-aware clients — with retries, typed errors and webhook signature helpers built in — are something we're working on with our partners.

Want a client library in your language?

Talk to us and tell us which language you need — partners help shape what we build.