Installation
Migrating from
@lendasat/lendaswap-sdk-pure? @satora/swap is a drop-in
replacement — change the package name in your imports and nothing else changes.
The legacy package keeps working and stays supported; new features land in
@satora/swap.The SDK is pure TypeScript - no WASM, no native dependencies.
It works in browsers, React Native, and Node.js without any bundler configuration.
Initialize Client
withReferralCode("your-api-key") on the ClientBuilder for swap attribution and custom fee markup — see API Keys.
Get Version
Verify the API is running before making swap requests.Best Practices
- Initialize Once - Create the client once using the builder, then reuse it for all operations
- Check Version First - Use
getVersion()to verify API connectivity before critical operations - Handle Errors - Wrap SDK calls in try/catch for proper error handling
- Use SDK - The TypeScript SDK handles complexity like key management, state tracking, and storage automatically