Skip to main content
Since this is a server-side SDK, the wallets are not self-custodial.
1

Install the Backend SDK

npm install @chipi-stack/backend
2

Get your API Keys

  1. Go to your API Keys in the Chipi Dashboard
  2. Copy your Public Key (pk_prod_xxxx) and Secret Key (sk_prod_xxxx)
Keep your Secret Key secure and never expose it in client-side code or version control.
3

Initialize the SDK

Create a new instance of the ChipiServerSDK with your API keys:
import { ChipiServerSDK } from "@chipi-stack/backend";

const serverClient = new ChipiServerSDK({
  apiPublicKey: "pk_prod_your_public_key",
  apiSecretKey: "sk_prod_your_secret_key",
});
4

Create Your First Wallet

Now you can create a wallet for your users:
const newWallet = await serverClient.createWallet({
  params: {
    encryptKey: "user-secure-pin",
    externalUserId: "your-user-id-123",
  },
});

console.log('New wallet created:', newWallet);
// Output: { wallet: { publicKey: "0x...", encryptedPrivateKey: "..." }, txHash: "0x..." }
5

Make Your First Transfer

Transfer tokens between wallets:
const transferResult = await serverClient.transfer({
  params: {
    encryptKey: "user-secure-pin",
    wallet: {
      publicKey: newWallet.wallet.publicKey,
      encryptedPrivateKey: newWallet.wallet.encryptedPrivateKey,
    },
    amount: "100",
    token: "USDC",
    recipient: "0x1234567890abcdef...",
  },
});

console.log('Transfer completed:', transferResult);
6

Environment Variables (Recommended)

For production applications, store your API keys as environment variables:
# .env
CHIPI_PUBLIC_KEY=pk_prod_your_public_key
CHIPI_SECRET_KEY=sk_prod_your_secret_key
Then initialize the SDK:
const serverClient = new ChipiServerSDK({
  apiPublicKey: process.env.CHIPI_PUBLIC_KEY!,
  apiSecretKey: process.env.CHIPI_SECRET_KEY!,
});

Next Steps

Now that you have the basic setup working, explore more advanced features:

Security Best Practices

  • Never expose your secret API key in client-side code
  • Use environment variables for API keys in production
  • Validate user inputs before making API calls
  • Implement proper error handling and logging
Need help? Join our Telegram Community for support and to connect with other developers.
I