phonelink/expo
API reference for the Phonelink Expo/React Native client.
Exports
The phonelink/expo entry point exports the following:
| Export | Type | Description |
|---|---|---|
phonelink | object | Expo client with a verify method |
PhonelinkPayload | type | TypeScript type for the decoded JWT payload |
phonelink.verify(clientId, redirectUrl?)
Opens a secure in-app browser for phone number verification and returns the result.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
clientId | string | — | Your Phonelink client ID |
redirectUrl | string | "phonelink://verify" | Deep link URI for your app |
Returns
Promise<{ token: string; nonce: string } | null>
- On success: returns
{ token, nonce }wheretokenis the signed JWT andnonceis the cryptographic nonce generated for this session - On cancellation: returns
nullif the user closes the browser without completing verification
Behavior
- Generates a 32-byte cryptographic nonce using
expo-crypto - Builds the Phonelink auth URL with
clientId,redirectUrl, andnonce - Opens the URL in an in-app browser via
WebBrowser.openAuthSessionAsync - Waits for the user to complete verification or cancel
- On success, extracts the
tokenfrom the redirect URL's query parameters - Returns
{ token, nonce }ornull
Peer dependencies
This function requires the following Expo packages to be installed:
| Package | Purpose |
|---|---|
expo-crypto | Cryptographic nonce generation |
expo-web-browser | In-app authentication browser session |
Install them with:
npx expo install expo-crypto expo-web-browserPhonelinkPayload
TypeScript interface for the decoded JWT payload. This is the same type exported by all entry points. See the Server API Reference for the full property list.
import type { PhonelinkPayload } from "phonelink/expo";