You need an API Key to use the Chainrails SDK. You can get one by signing up on our dashboard or contacting us at contact@horuslabs.co.
Overview
Chainrails provides client SDKs for web and mobile applications:@chainrails/sdk: Core TypeScript SDK for interacting with the Chainrails API@chainrails/react: React components and hooks for web integrations@chainrails/react-native: React Native components and hooks for mobile integrations
Installation
- Core SDK
- React Web
- React Native
SDK Modules
The SDK is organized into the following modules:Intents
Create and manage cross-chain transfer intents, track payment status, and retrieve intent information.Router
Find optimal routes and analyze bridge availability for cross-chain transfers.Quotes
Get real-time quotes for cross-chain transfers from various bridge providers.Chains
Retrieve information about supported blockchain networks and tokens.Client
Retrieve authenticated client information.Platform Support
Recommended Package by Use Case
- Use
@chainrails/sdkfor server-side integrations and direct API access from TypeScript/JavaScript - Use
@chainrails/reactfor web apps that need the Payment Modal and session hooks - Use
@chainrails/react-nativefor React Native apps that need mobile payment flows
Authentication
The SDK uses API key-based authentication. Configure your API key once at startup:Authorization: Bearer header.
Error Handling
The SDK throws errors for failed requests. Wrap SDK calls in try-catch blocks:Type Definitions
The SDK includes full TypeScript type definitions for all requests and responses, providing autocomplete and type safety in your IDE.Additional Notes
- Live API keys cannot be used with test networks. In test environments you can use supported mainnets and testnets, but live API keys must use mainnet networks only.
-
Testnets also do not have indexing support. In modal flows, users must click I have made payment after funding on testnets. In
API-driven flows, use
POST /api/v1/intents/{intent_address}/trigger-processingto process the intent manually.

