Skip to main content
Chainrails offers both client SDKs and a RESTful API, each designed for different needs and levels of abstraction.

The SDK

Chainrails SDKs provide the fastest way to integrate payments in TypeScript/JavaScript applications. They wrap our APIs and handle authentication, retries, UI flows, and session-based payment experiences for you. We recommend using the SDK for:
  • Web applications and dApps that requires a pre-built modal
  • React Native mobile applications that also don’t mind a pre-built modal
  • Quick prototyping
  • JavaScript/TypeScript projects
  • Reducing boilerplate (no need to manually handle HTTP or auth)
The SDK surface includes:
  • @chainrails/sdk for core API access
  • @chainrails/react for React web integrations
  • @chainrails/react-native for React Native integrations

Sample integration

Installation
For React Native apps:
Usage First, create a server endpoint for session creation:
Then use the SDK on the client:
For more details on the SDK, check out our SDK Reference and Quickstart guides.

The API

The Chainrails API gives you direct access to the underlying infrastructure — perfect if you want full control over how requests, authentication, and responses are handled. You’ll interact with our endpoints directly using your preferred language or HTTP client. We recommend using the API for:
  • Server-side integrations
  • Advanced use cases requiring fine-grained control
  • Teams working in non-JavaScript environments

Sample request to create a cross-chain intent

For more details on the API, check out our API Reference.