Skip to main content

Get started with the SDK

Include the SDK

You can install the SDK with your favorite package manager (e.g.,npm, yarn):
React Native

Initialize the SDK

Initialize a Payrails client as shown below, with configuration:
React Native
Your backend should call the Initialize a client SDK endpoint, then forward the response to the SDK.

Optional: custom return URLs for redirect payments

If your integration uses redirect-based payment methods such as Lean or Generic Redirect, you can also pass returnInfo to PayrailsProvider.
React Native
  • If returnInfo is omitted, the SDK uses its default hosted return URLs instead.
  • The base return URLs must also be configured in the Payrails Admin Portal. Contact the Payrails team for that setup.
  • returnInfo defines where the payment provider redirects the user. Redirection does not emit terminal SDK callbacks such as onAuthorizeSuccess, onAuthorizeFailure, or onAuthorizeCancel.

Last modified on September 21, 2026