Quickstart

Kredo is a shared value network for applications. Users fund one balance and spend it in any app on the network. You charge them with one call and get paid in USDT.

1 · User

Buys credits

Once, with USDT. Works in every app.

2 · User

Connects your app

Approves a spending limit, one tap.

3 · You

Charge

One call. Settles on Whitechain.

1. Get an API key

Open the dashboard, sign in with your email and register your app. You get an API key. Keep it on your server.

CREDITS_API_KEY=uc_live_...

2. Install the SDK

npm install kredo
import { Credits } from "kredo";
 
const credits = new Credits({
  apiKey: process.env.CREDITS_API_KEY!,
  baseUrl: process.env.CREDITS_API_URL,
  pagesUrl: process.env.CREDITS_PAGES_URL,
});

3. Connect a user

Send the user to our page to approve a spending limit. They come back with a code, which you swap for their address.

// Send them to approve a limit
res.redirect(await credits.connectUrl({ credits: 200, returnTo: "https://your.app/callback" }));
 
// On /callback
const { user } = await credits.exchangeCode(req.query.code);

4. Charge

await credits.charge({ user, credits: 5 });

That's it. The charge settles on Whitechain before the call returns, and you withdraw your earnings in USDT from the dashboard.

Test mode

Use a uc_test_ key while you build. Nothing goes onchain, every test user starts with 1,000 credits, and the rules are the same as live.

Next