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

# React Native

> Install IDKit in React Native apps with Expo and use the headless hooks.

Use IDKit's hooks to manage verification requests and read their status and results while rendering your own native UI. The integration below supports Expo SDK 57.

## Expo

### Install

Install IDKit and Expo Crypto:

```bash theme={"system"}
npx expo install @worldcoin/idkit expo-crypto
```

### Import

Import hooks and presets from `@worldcoin/idkit/expo`:

```tsx theme={"system"}
import { useIDKitRequest, proofOfHuman } from "@worldcoin/idkit/expo";
```

The `/expo` entry configures secure randomness automatically. No global polyfill or runtime configuration is required.

`@worldcoin/idkit/hooks` exports the same hooks without loading browser widgets or configuring Expo Crypto. The `/expo` entry adds that automatic configuration, so Expo apps only need the `/expo` import above.

### Verification screen

Fetch a fresh, signed `rpContext` from your backend before showing this screen. Replace the app ID and action with your application's values.

```tsx theme={"system"}
import { Alert, Button, Linking, Text, View } from "react-native";
import {
  useIDKitRequest,
  proofOfHuman,
  type RpContext,
} from "@worldcoin/idkit/expo";

export function VerificationScreen({ rpContext }: { rpContext: RpContext }) {
  const flow = useIDKitRequest({
    app_id: "app_your_app_id",
    action: "verify-human",
    rp_context: rpContext,
    preset: proofOfHuman(),
    allow_legacy_proofs: false,
    return_to: "myapp://verified",
  });

  return (
    <View>
      <Button
        title="Start verification"
        onPress={flow.open}
        disabled={flow.isOpen}
      />

      {flow.connectorURI && !flow.result && !flow.isError && (
        <Button
          title="Open World App"
          onPress={() => {
            Linking.openURL(flow.connectorURI!).catch(() => {
              Alert.alert("Could not open World App", "Please try again.");
            });
          }}
        />
      )}

      {flow.isAwaitingUserConfirmation && <Text>Waiting for approval…</Text>}
      {flow.isError && <Text>Verification failed: {flow.errorCode}</Text>}
      {flow.result && (
        <Text>Proof received — ready for backend verification.</Text>
      )}
    </View>
  );
}
```

`flow.open()` creates the request and starts polling. Your app opens World App using `Linking.openURL`; the hook does not render a screen or open World App automatically.

Configure the `myapp://` callback scheme in your app to match `return_to`. Send `flow.result` to your backend for verification before granting access. Keep RP signing keys on your backend.

See the [headless hooks reference](/world-id/idkit/react#headless-hooks) for hook options and result fields. IDKit's web widgets are for browser integrations.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.