Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/pages/wallets/auth/google-oauth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
**USE FOR INTERNAL TESTING PURPOSES ONLY.** You may use these features solely for internal evaluation purposes on supported testnets. DO NOT use for production use or share with your users. Wallets created during this preview ("Alpha Wallets") will be discontinued. Any tokens remaining within Alpha Wallets will be permanently lost upon discontinuance. Any mainnet tokens sent to an Alpha Wallet will not be deposited and will be permanently lost when discontinued. We are unable to help recover any lost funds from Alpha Wallets. We provide all previews on an "as is" basis without warranty of any kind, and we may terminate or suspend the availability of any preview at any time.
:::

:::info[Using React Native?]
This page covers the web flow. For Expo / React Native, see [Google OAuth on React Native](/wallets/react-native/google-oauth).
:::

Google OAuth lets users sign in with their Google account using a popup-based flow. The SDK handles the popup, redirect, and session creation automatically.

By default, the Google OAuth flow uses a Zerodev-managed Google account for authentication. This allows you to get started quickly without any additional configuration. You can customize the OAuth flow by providing your own Google OAuth client ID and secret in the developer dashboard.
Expand Down
4 changes: 4 additions & 0 deletions docs/pages/wallets/auth/magic-link.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
**USE FOR INTERNAL TESTING PURPOSES ONLY.** You may use these features solely for internal evaluation purposes on supported testnets. DO NOT use for production use or share with your users. Wallets created during this preview ("Alpha Wallets") will be discontinued. Any tokens remaining within Alpha Wallets will be permanently lost upon discontinuance. Any mainnet tokens sent to an Alpha Wallet will not be deposited and will be permanently lost when discontinued. We are unable to help recover any lost funds from Alpha Wallets. We provide all previews on an "as is" basis without warranty of any kind, and we may terminate or suspend the availability of any preview at any time.
:::

:::info[Using React Native?]
This page covers the web flow. For Expo / React Native, see [Magic Link on React Native](/wallets/react-native/magic-link).
:::

Magic links let users authenticate by clicking a link in their email. The link redirects to your app where the SDK completes the verification.

## Hooks
Expand Down
4 changes: 4 additions & 0 deletions docs/pages/wallets/auth/passkeys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
**USE FOR INTERNAL TESTING PURPOSES ONLY.** You may use these features solely for internal evaluation purposes on supported testnets. DO NOT use for production use or share with your users. Wallets created during this preview ("Alpha Wallets") will be discontinued. Any tokens remaining within Alpha Wallets will be permanently lost upon discontinuance. Any mainnet tokens sent to an Alpha Wallet will not be deposited and will be permanently lost when discontinued. We are unable to help recover any lost funds from Alpha Wallets. We provide all previews on an "as is" basis without warranty of any kind, and we may terminate or suspend the availability of any preview at any time.
:::

:::info[Using React Native?]
This page covers the web flow. For Expo / React Native, see [Passkeys on React Native](/wallets/react-native/passkeys).
:::

Passkeys use the [WebAuthn](https://webauthn.guide/) standard for passwordless authentication. Users authenticate with biometrics (Face ID, Touch ID, fingerprint) or a hardware security key.

## Configure RP ID (optional)
Expand Down
4 changes: 4 additions & 0 deletions docs/pages/wallets/export.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
**USE FOR INTERNAL TESTING PURPOSES ONLY.** You may use these features solely for internal evaluation purposes on supported testnets. DO NOT use for production use or share with your users. Wallets created during this preview ("Alpha Wallets") will be discontinued. Any tokens remaining within Alpha Wallets will be permanently lost upon discontinuance. Any mainnet tokens sent to an Alpha Wallet will not be deposited and will be permanently lost when discontinued. We are unable to help recover any lost funds from Alpha Wallets. We provide all previews on an "as is" basis without warranty of any kind, and we may terminate or suspend the availability of any preview at any time.
:::

:::info[Using React Native?]
The export hooks on this page are web-only. On Expo / React Native, use the [`ZeroDevExportWebView` component](/wallets/react-native/export-wallet) instead.
:::

The SDK supports exporting the user's wallet as a seed phrase or private key. The key material is displayed inside a secure iframe and never touches your application code.

## Hooks
Expand Down
81 changes: 81 additions & 0 deletions docs/pages/wallets/hooks/export-web-view.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# ZeroDevExportWebView [Component for exporting a wallet on React Native]

:::danger[IMPORTANT]
**USE FOR INTERNAL TESTING PURPOSES ONLY.** You may use these features solely for internal evaluation purposes on supported testnets. DO NOT use for production use or share with your users. Wallets created during this preview ("Alpha Wallets") will be discontinued. Any tokens remaining within Alpha Wallets will be permanently lost upon discontinuance. Any mainnet tokens sent to an Alpha Wallet will not be deposited and will be permanently lost when discontinued. We are unable to help recover any lost funds from Alpha Wallets. We provide all previews on an "as is" basis without warranty of any kind, and we may terminate or suspend the availability of any preview at any time.
:::

A React Native component that renders Turnkey's export iframe inside an isolated WebView, so the decrypted seed phrase or private key never touches your app's JavaScript. It replaces the web-only [`useExportWallet`](/wallets/hooks/use-export-wallet) and [`useExportPrivateKey`](/wallets/hooks/use-export-private-key) hooks on React Native.

Mounting the component starts the export; unmounting it dismisses the secret. See [Export Wallet on React Native](/wallets/react-native/export-wallet) for the full guide.

Requires the `react-native-webview` and `uuid` peer dependencies, and an `rpId` configured on the connector (see [Configuration](/wallets/react-native/configuration)).

## Import

```tsx
import { ZeroDevExportWebView } from "@zerodev/wallet-react/react-native/export/webview";
```

## Usage

```tsx
import { ZeroDevExportWebView } from "@zerodev/wallet-react/react-native/export/webview";
import { useState } from "react";
import { Button, Text } from "react-native";

function ExportWallet() {
const [show, setShow] = useState(false);
const [ready, setReady] = useState(false);
const [error, setError] = useState<string | null>(null);

return (
<>
<Button title="Export wallet" onPress={() => setShow(true)} />

{show && !ready && !error ? <Text>Loading…</Text> : null}
{error ? <Text style={{ color: "red" }}>{error}</Text> : null}

{show && !error ? (
<ZeroDevExportWebView
kind="wallet"
onReady={() => setReady(true)}
onError={(message) => setError(message)}
style={ready ? { height: 240 } : { height: 0 }}
/>
) : null}
</>
);
}
```

## Props

### kind

`'wallet' | 'privateKey'`

**Required.** What to export: `'wallet'` reveals the account's seed phrase, `'privateKey'` reveals the account's private key.

### onReady

`() => void`

Optional. Called once the secret is rendered inside the WebView. Use it to hide your loading state and give the WebView a visible height.

### onError

`(message: string) => void`

Optional. Called with an error message if the export fails. Unmount the component and surface the message to the user.

### style

`StyleProp<ViewStyle>`

Optional. Style for the WebView container. A common pattern is `{ height: 0 }` until [`onReady`](#onready) fires, then a visible height.

## Notes

- The component holds no state — mount it to start an export, unmount it to dismiss the secret.
- The decrypted secret is only ever rendered inside Turnkey's export iframe within the WebView; it never crosses into your app's JavaScript context.
- Requires a [development build](https://docs.expo.dev/develop/development-builds/expo-go-to-dev-build/) on Expo, since `react-native-webview` is a native module.
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import MutationResult from "../shared/mutation-result.mdx";

# useAuthenticateOAuthWithExpoWebBrowser [Hook for authenticating with an OAuth provider on React Native]

:::danger[IMPORTANT]
**USE FOR INTERNAL TESTING PURPOSES ONLY.** You may use these features solely for internal evaluation purposes on supported testnets. DO NOT use for production use or share with your users. Wallets created during this preview ("Alpha Wallets") will be discontinued. Any tokens remaining within Alpha Wallets will be permanently lost upon discontinuance. Any mainnet tokens sent to an Alpha Wallet will not be deposited and will be permanently lost when discontinued. We are unable to help recover any lost funds from Alpha Wallets. We provide all previews on an "as is" basis without warranty of any kind, and we may terminate or suspend the availability of any preview at any time.
:::

The React Native counterpart of [`useAuthenticateOAuth`](/wallets/hooks/use-authenticate-oauth). Instead of the web popup flow, it opens the system auth browser via `expo-web-browser` and completes the flow when the OAuth redirect deep-links back into the app — whichever arrives first, the browser result or the deep link.

Requires the `expo-web-browser` and `expo-linking` peer dependencies. See [Google OAuth on React Native](/wallets/react-native/google-oauth) for the full setup, including the callback route and Dashboard allowlisting.

## Import

```tsx
import { useAuthenticateOAuthWithExpoWebBrowser } from "@zerodev/wallet-react/react-native/oauth/with-expo-web-browser";
```

## Usage

```tsx
import { OAUTH_PROVIDERS } from "@zerodev/wallet-react";
import { useAuthenticateOAuthWithExpoWebBrowser } from "@zerodev/wallet-react/react-native/oauth/with-expo-web-browser";
import * as Linking from "expo-linking";
import { Button } from "react-native";
import { useAccount } from "wagmi";

function OAuthLogin() {
const auth = useAuthenticateOAuthWithExpoWebBrowser({
redirectUri: Linking.createURL("oauth-callback"),
});
const { isConnected } = useAccount();

if (isConnected) return null;

return (
<Button
title={auth.isPending ? "Signing in..." : "Sign in with Google"}
disabled={auth.isPending}
onPress={() => auth.mutate({ provider: OAUTH_PROVIDERS.GOOGLE })}
/>
);
}
```

## Parameters

### redirectUri

`string`

**Required.** The URI the OAuth flow redirects back to after sign-in. Either a custom-scheme deep link (e.g. `Linking.createURL('oauth-callback')`) or an [App Link](/wallets/react-native/google-oauth#using-an-app-link-as-the-redirect) on your verified domain (e.g. `https://<your domain>/oauth-callback`). The URL must be allowlisted on the [ZeroDev Dashboard](https://dashboard.zerodev.app/), and your app must have a route that catches it.

## Mutation Parameters

### provider

`OAuthProvider`

**Required.** The OAuth provider to authenticate with, passed to `mutate`/`mutateAsync`. Use the `OAUTH_PROVIDERS` constant:

- `OAUTH_PROVIDERS.GOOGLE` — Google OAuth

## Return Types

[TanStack Query mutation docs](https://tanstack.com/query/v5/docs/react/reference/useMutation)

### mutate

`(variables: { provider: OAuthProvider }) => void`

The mutation function to start the OAuth flow. Opens the system auth browser for the user to sign in.

### mutateAsync

`(variables: { provider: OAuthProvider }) => Promise<void>`

Similar to [`mutate`](#mutate) but returns a promise. Resolves when the OAuth flow completes and the wallet is connected.

### data

`void`

This mutation does not return data. On success, the Wagmi connector is connected and the account is available via `useAccount`.

<MutationResult />
4 changes: 4 additions & 0 deletions docs/pages/wallets/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
**USE FOR INTERNAL TESTING PURPOSES ONLY.** You may use these features solely for internal evaluation purposes on supported testnets. DO NOT use for production use or share with your users. Wallets created during this preview ("Alpha Wallets") will be discontinued. Any tokens remaining within Alpha Wallets will be permanently lost upon discontinuance. Any mainnet tokens sent to an Alpha Wallet will not be deposited and will be permanently lost when discontinued. We are unable to help recover any lost funds from Alpha Wallets. We provide all previews on an "as is" basis without warranty of any kind, and we may terminate or suspend the availability of any preview at any time.
:::

:::info[Using React Native?]
This page covers the web flow. For Expo / React Native, see [the React Native quickstart](/wallets/react-native/quickstart).
:::

## Installation

:::code-group
Expand Down
Loading