Installation
Caishen SDK – Plug & Play SDK JS
The Caishen SDK provides developers with seamless access to multichain wallets and gasless payment tools. With built-in support for Ethereum, Solana, Bitcoin, Sui, and XRP, you can integrate wallets, automate agents, and send cash instantly using only a few lines of code.
Caishen supports Typescript (for browser and Node.js) and Python (for backend automation and bots). You can build wallet-aware apps, agent-based bots, or embedded finance experiences with no seed phrases or infrastructure costs.
Requirements
For Typescript (Node.js / Browser)
Node.js v16+
Basic understanding of Promises and async/await
Supports React, Next.js, Vite, Vanilla JS, etc.
Resources
Example Applications: View working wallet + cash agent integrations.
Troubleshooting: Common setup issues and sandbox tips.
Source Code: Full SDK code and dev toolkits.
Support Portal: Get help directly from the Caishen team or join the community.
📦 Installation
⚠️ Requires Node.js ≥ 14.x and TypeScript ≥ 4.x
🚀 Quick Start
🔑 Authentication
You can authenticate as either a user or an agent.
Connect as User
✅ Supported Providers
google,facebook,twitter,discord,github,linkedinreddit,line,kakao,weibo,farcaster,custom
🔐 Custom Authentication
If you want to authenticate users from your own backend, you can use the custom provider.
In this case:
You must encrypt a JWT on your backend using your
projectSecret(found in your Caishen developer dashboard).That encrypted token must contain an object like
{ id: string }, whereidis the user identifier in your system.You then pass this encrypted token into
connectAsUser.
💡 Example
Backend-side (Node.js):
Frontend-side:
On the Caishen backend, this token is decrypted with your projectSecret using:
⚠️ Never share your
projectSecretpublicly. Only your server should have access to it.
Connect as Agent
Different values for
agentIdanduserIdwill generate different wallet scopes.
Last updated