> ## Documentation Index
> Fetch the complete documentation index at: https://docs.socket.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# SocketFi Supported Platforms, Browsers, and Runtimes

> Platform and browser support for the SocketFi SDKs — React, React Native, Expo, Node.js, minimum browser versions, and WebAuthn requirements.

SocketFi provides three SDKs covering frontend web, mobile, and backend environments. This page lists the officially supported versions, runtime requirements, and browser compatibility information for each. If your platform isn't listed here, it may still work, but it has not been validated by the SocketFi team.

<Note>
  HTTPS is required in all production environments. WebAuthn (the standard underlying passkeys) will not operate on pages served over plain HTTP. You can use `localhost` without HTTPS during local development.
</Note>

***

## Web SDK — `@socketfi/react`

The web SDK targets React applications running in modern browsers. It handles authentication via a hosted popup flow and exposes `authenticate()`, `requestTransaction()`, and `readContract()`.

### Supported frameworks

| Framework | Minimum version | Notes                                      |
| --------- | --------------- | ------------------------------------------ |
| React     | 18.0            | Hooks API required                         |
| Next.js   | 14.0            | App Router and Pages Router both supported |
| Vite      | 4.0             | Recommended bundler for new projects       |

### Installation

```bash theme={null}
npm install @socketfi/react
```

### Initialization

```typescript theme={null}
import { SocketFi } from "@socketfi/react";

const socketfi = new SocketFi({
  clientId: import.meta.env.VITE_SOCKETFI_CLIENT_ID,
  network: "TESTNET", // or "MAINNET"
});
```

### Supported browsers

The web SDK requires a browser with WebAuthn support. The following table lists the minimum confirmed versions.

| Browser | Minimum version | Passkey support | Notes                                  |
| ------- | --------------- | --------------- | -------------------------------------- |
| Chrome  | 108             | ✅ Full          | Recommended for development            |
| Edge    | 108             | ✅ Full          | Chromium-based; same support as Chrome |
| Safari  | 16              | ✅ Full          | Face ID / Touch ID on macOS and iOS    |
| Firefox | 119             | ✅ Full          | Passkey support added in 119           |

<Warning>
  Older browser versions may support WebAuthn but not passkeys (discoverable credentials). Always test your authentication flow on the exact browser versions your users are likely to use.
</Warning>

### Server-side rendering (SSR)

SocketFi works with SSR frameworks like Next.js and Remix. Authentication and transaction flows must run on the client — use dynamic imports or client-only guards where necessary.

```typescript theme={null}
// Next.js App Router — mark the component as a Client Component
"use client";

import { SocketFi } from "@socketfi/react";
```

***

## React Native SDK — `@socketfi/react-native`

The React Native SDK brings SocketFi authentication and transactions to iOS and Android apps. Authentication opens in the device's system browser and returns to your app via deep link.

### Supported runtimes

| Framework    | Minimum version | Notes                                     |
| ------------ | --------------- | ----------------------------------------- |
| React Native | 0.76            | New Architecture (Fabric) compatible      |
| Expo SDK     | 53              | Managed and bare workflows both supported |

### Supported platforms

| Platform | Passkey mechanism                                 | Deep link support |
| -------- | ------------------------------------------------- | ----------------- |
| iOS      | Face ID, Touch ID, hardware security key          | ✅ Required        |
| Android  | Biometric (fingerprint, face), Credential Manager | ✅ Required        |

### Installation

```bash theme={null}
npm install @socketfi/react-native expo-linking expo-secure-store
```

### Deep link configuration (Expo)

Add your app's custom URL scheme to `app.json`. This scheme is required for the authentication flow to return to your app after the user approves in the system browser.

```json theme={null}
{
  "expo": {
    "scheme": "myapp",
    "ios": { "bundleIdentifier": "com.example.myapp" },
    "android": { "package": "com.example.myapp" }
  }
}
```

### Session storage on mobile

Use secure device storage rather than `localStorage`. `expo-secure-store` encrypts values using the platform's native keystore.

```typescript theme={null}
import * as SecureStore from "expo-secure-store";

// Save session
await SecureStore.setItemAsync("socketfi_session", JSON.stringify(session));

// Restore on startup
const raw = await SecureStore.getItemAsync("socketfi_session");
if (raw) setSession(JSON.parse(raw));
```

<Tip>
  Run `expo prebuild` after changing your URL scheme in `app.json`. The scheme is baked into native build files and changes won't take effect until you rebuild.
</Tip>

***

## Server SDK — `@socketfi/server`

The server SDK is a lightweight Node.js package that exposes `verifyAuth()` for server-side token verification. It is framework-agnostic — use it with any Node.js server runtime.

### Supported runtimes

| Runtime                           | Minimum version | Notes                                 |
| --------------------------------- | --------------- | ------------------------------------- |
| Node.js                           | 20 LTS          | Recommended: latest LTS release       |
| Serverless (Lambda, Vercel, etc.) | —               | Supported; cold-start time is minimal |

### Supported frameworks

The server SDK works with any framework that can receive HTTP requests and read headers. The following have been tested:

| Framework | Notes                                                                |
| --------- | -------------------------------------------------------------------- |
| Express   | See the [Server Verification example](/examples/server-verification) |
| Fastify   | Use as a `preHandler` hook                                           |
| NestJS    | Implement as a Guard or Interceptor                                  |
| Hono      | Use as middleware                                                    |
| Koa       | Use as `app.use()` middleware                                        |

### Installation

```bash theme={null}
npm install @socketfi/server
```

### Usage

```typescript theme={null}
import { verifyAuth } from "@socketfi/server";

const result = await verifyAuth(token);
// { valid: boolean, user: { id: string }, wallet: string }
```

***

## WebAuthn and passkey requirements

SocketFi's authentication layer is built on WebAuthn (FIDO2). The following conditions must be met for passkeys to work:

<CardGroup cols={2}>
  <Card title="Secure context" icon="lock">
    The page or app must be served over HTTPS in production. `localhost` is treated as a secure context for development.
  </Card>

  <Card title="Enrolled authenticator" icon="fingerprint">
    The user's device must have at least one biometric method or security key enrolled (Face ID, Touch ID, Windows Hello, or a FIDO2 hardware key).
  </Card>

  <Card title="Browser WebAuthn support" icon="globe">
    The browser must support the WebAuthn API. All browsers in the supported table above qualify; IE and very old browser versions do not.
  </Card>

  <Card title="Domain-scoped credentials" icon="shield">
    Passkeys are scoped to a specific domain. A passkey registered on `app.example.com` cannot be used on a different domain.
  </Card>
</CardGroup>

***

## Platform compatibility summary

| Capability             | Web (React)      | React Native (Expo) | Backend (Node.js) |
| ---------------------- | ---------------- | ------------------- | ----------------- |
| `authenticate()`       | ✅                | ✅                   | —                 |
| `requestTransaction()` | ✅                | ✅                   | —                 |
| `readContract()`       | ✅                | ✅                   | —                 |
| `verifyAuth()`         | —                | —                   | ✅                 |
| Passkey / WebAuthn     | Browser-native   | Device-native       | —                 |
| Session persistence    | `localStorage`   | `SecureStore`       | —                 |
| Deep link required     | No               | Yes                 | —                 |
| HTTPS required         | Yes (production) | Yes (production)    | Yes (production)  |

***

## Compatibility checklist

Before going to production, verify the following on each target platform:

```text theme={null}
✓ @socketfi/react or @socketfi/react-native installed at a supported version
✓ Node.js 20+ on the backend
✓ HTTPS certificate configured (frontend and backend)
✓ WebAuthn tested on each target browser / device
✓ Deep link scheme registered in app.json and native build files (mobile)
✓ Session persisted to SecureStore (mobile) or localStorage (web)
✓ verifyAuth() middleware applied to all protected API routes
✓ Tested on TESTNET before switching to MAINNET
```
