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.
Buys credits
Once, with USDT. Works in every app.
Connects your app
Approves a spending limit, one tap.
Charge
One call. Settles on NEAR.
1. Get your keys
Open the dashboard, sign in with your email and register your app. You get an API key. Keep it on your server.
Live charges also need your app's signer key. Your app gets its own NEAR account, and only that account's key can charge for your app. Not even Kredo can. See who signs a charge.
CREDITS_API_KEY=uc_live_...
CREDITS_SIGNER_KEY=ed25519:... # live only; test keys don't need it2. Install the SDK
npm install kredoimport { Credits } from "kredo";
const credits = new Credits({
apiKey: process.env.CREDITS_API_KEY!,
signerKey: process.env.CREDITS_SIGNER_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 NEAR account.
// 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 NEAR before the call returns, and you withdraw your earnings in USDT from the dashboard.
Test mode
Use a uc_test_ key while you build. You don't need a signer key yet. Nothing goes onchain, every test user starts with 1,000 credits, and the rules are the same as live.
Next
- Building in React? Use the React kit: drop-in buttons and a live balance.
- Long jobs? Hold, then charge what it actually cost.
- Want to know why it's safe? Read How it works.