Skip to content

Commit 5dfde0f

Browse files
Add guest mode documentation (#4910)
Signed-off-by: Ian Mukherjee <ian@thirdweb.com> Co-authored-by: Joaquim Verges <joaquim.verges@gmail.com>
1 parent b148fa0 commit 5dfde0f

File tree

4 files changed

+64
-0
lines changed

4 files changed

+64
-0
lines changed

apps/portal/src/app/connect/in-app-wallet/guides/link-multiple-profiles/page.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ Note that the `email` field above will differ based on the profile type. We list
8484

8585
| Strategy | Type | `details` Field |
8686
| ------------- | ----------------- | --------------- |
87+
| Guest | `"guest"` | `id` |
8788
| Email | `"email"` | `email` |
8889
| Phone | `"phone"` | `phone` |
8990
| Passkey | `"passkey"` | `id` |

apps/portal/src/app/connect/in-app-wallet/guides/retrieve-linked-profiles/page.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Note that the `email` field above will differ based on the profile type. We list
2929

3030
| Strategy | Type | `details` Field |
3131
| ------------- | ----------------- | --------------- |
32+
| Guest | `"guest"` | `id` |
3233
| Email | `"email"` | `email` |
3334
| Phone | `"phone"` | `phone` |
3435
| Passkey | `"passkey"` | `id` |

apps/portal/src/app/connect/sidebar.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ export const sidebar: SideBar = {
132132
name: "External Wallets",
133133
href: `${connectSlug}/methods/external-wallets`,
134134
},
135+
{
136+
name: "Guest Mode",
137+
href: `${connectSlug}/methods/guest-mode`,
138+
},
135139
],
136140
},
137141
{
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import { createMetadata } from "@doc";
2+
3+
export const metadata = createMetadata({
4+
image: {
5+
title: "Guest Mode",
6+
icon: "wallets",
7+
},
8+
title: "Guest Mode",
9+
description:
10+
"Learn how to get users started in your app without requiring sign-in.",
11+
});
12+
13+
# Guest Mode
14+
15+
Sometimes users want to get started using your app without signing in. You can now give users an in-memory "guest account" that can then be converted into a standard account by linking another auth method.
16+
17+
## With `inAppWallet`
18+
19+
```tsx
20+
import { inAppWallet } from "thirdweb/wallets";
21+
22+
const wallet = inAppWallet();
23+
24+
// Create the temporary guest account
25+
const account = await wallet.connect({
26+
client,
27+
strategy: "guest",
28+
});
29+
```
30+
31+
When your user is ready, [link any other auth method](/connect/in-app-wallet/guides/link-multiple-profiles) so they can access their account in the future.
32+
33+
```tsx
34+
import { linkProfile } from "thirdweb/wallets";
35+
36+
await linkProfile(wallet, { strategy: "google" });
37+
```
38+
39+
Your user can now access this same wallet with their Google account. Until the user links another profile to the wallet, it will be stored in memory and last until they clear their browser cookies or connect a different wallet.
40+
41+
## With `ConnectButton`
42+
43+
```tsx
44+
import { ConnectButton } from "thirdweb/react";
45+
import { inAppWallet } from "thirdweb/wallets";
46+
47+
<ConnectButton
48+
wallets={[
49+
inAppWallet({
50+
auth: {
51+
options: ["google", "discord", "telegram", "email", "phone", "guest"],
52+
},
53+
}),
54+
]}
55+
/>;
56+
```
57+
58+
You can try out Guest Mode [on our playground.](https://playground.thirdweb.com/connect/sign-in/button)

0 commit comments

Comments
 (0)