Install the SDK
Install Expo dependencies
The SDK usesexpo-web-browser to open hosted authentication and approval screens, and expo-linking to handle the deep link that brings users back to your app after they complete the flow. Install both with the Expo CLI so they are pinned to a version compatible with your Expo SDK:
Always use
npx expo install rather than plain npm install for Expo packages. This ensures the installed version is compatible with your current Expo SDK version and avoids hard-to-debug runtime errors.Configure your app scheme
SocketFi needs a custom URL scheme to redirect users back to your app after authentication. Add thescheme field to app.json:
app.json
acmepay, myfinanceapp). After the user authenticates, SocketFi will redirect them to:
Set up environment variables
Store your Client ID in an environment variable using Expo’s config system. Add it to a.env file at the root of your project:
.env
Initialize the SocketFi client
Create a shared instance in a dedicated file and import it wherever you need it. Avoid constructing multiple instances across different components.lib/socketfi.ts
Full configuration example
lib/socketfi.ts
ParamField reference.
Minimal working example
Once the client is initialized, you can trigger authentication from a button:App.tsx
HTTPS is not required during React Native development — Expo’s dev server and the Metro bundler run over HTTP locally and this is fine. However, all SocketFi API calls made from production builds must go over HTTPS. Configure your production environment accordingly before submitting to app stores.
Next steps
With the SDK installed and initialized, configure deep linking so SocketFi can return users to your app after authentication:Configure Deep Linking
Set up expo-linking event listeners and handle the SocketFi redirect URLs.