Skip to content

Commit 6803e98

Browse files
committed
docs: add guest documentation
1 parent db4179c commit 6803e98

File tree

5 files changed

+89
-2
lines changed

5 files changed

+89
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export const sidebar: SideBar = {
122122
links: [
123123
{
124124
name: "Guest Mode",
125-
href: `${connectSlug}/methods/guest-mode`,
125+
href: `${walletSlug}/sign-in-methods/guest`,
126126
},
127127
{
128128
name: "Social Login",

apps/portal/src/app/connect/wallet/get-started/overview/page.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
ExternalLinkIcon,
88
UnrealEngineIcon
99
} from "@/icons"
10-
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs";
1110

1211
export const metadata = createMetadata({
1312
image: {
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import { createMetadata, Callout, CodeBlock, Tabs, TabsContent, TabsList, TabsTrigger, } 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 thirdweb wallets 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+
<Callout variant='info' title="Guest Mode Support">
18+
Guest mode is supported in both Ecosystem Wallets and In-App Wallets.
19+
20+
The examples below show how to use Guest Mode with In-App Wallets, but the same principles apply to Ecosystem Wallets.
21+
</Callout>
22+
23+
<Tabs defaultValue={"typescript"}>
24+
<TabsList>
25+
<TabsTrigger value="typescript">typescript</TabsTrigger>
26+
<TabsTrigger value="react">react/react native</TabsTrigger>
27+
<TabsTrigger value="dotnet">.NET</TabsTrigger>
28+
</TabsList>
29+
<TabsContent value="typescript">
30+
<CodeBlock code={`import { inAppWallet } from "thirdweb/wallets";
31+
const wallet = inAppWallet();
32+
33+
// Create the temporary guest account
34+
const account = await wallet.connect({
35+
client,
36+
strategy: "guest",
37+
});`} lang="typescript" />
38+
</TabsContent>
39+
<TabsContent value="react">
40+
<CodeBlock code={`
41+
import { ConnectButton } from "thirdweb/react";
42+
import { inAppWallet } from "thirdweb/wallets";
43+
44+
<ConnectButton
45+
wallets={[
46+
inAppWallet({
47+
auth: {
48+
options: ["google", "discord", "telegram", "email", "phone", "guest"],
49+
},
50+
}),
51+
]}
52+
/>;`} lang="jsx" />
53+
</TabsContent>
54+
<TabsContent value="dotnet">
55+
<CodeBlock code={`var wallet = await InAppWallet.Create(client: client, authProvider: AuthProvider.Guest);
56+
var address = await wallet.LoginWithGuest();`} lang="csharp" />
57+
</TabsContent>
58+
</Tabs>
59+
60+
61+
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.
62+
63+
<Tabs defaultValue={"typescript"}>
64+
<TabsList>
65+
<TabsTrigger value="typescript">typescript/react/react-native</TabsTrigger>
66+
<TabsTrigger value="dotnet">.NET</TabsTrigger>
67+
</TabsList>
68+
<TabsContent value="typescript">
69+
<CodeBlock code={`import { linkProfile } from "thirdweb/wallets";
70+
71+
await linkProfile(wallet, { strategy: "google" });`} lang="typescript" />
72+
</TabsContent>
73+
<TabsContent value="dotnet">
74+
<CodeBlock code={`var socialWallet = await InAppWallet.Create(client: client, authProvider: AuthProvider.Telegram);
75+
_ = await inAppWalletMain.LinkAccount(walletToLink: socialWallet,);`} lang="csharp" />
76+
</TabsContent>
77+
</Tabs>
78+
79+
Your user can now access this same wallet with their Google account.
80+
81+
While it is not linked to any other identity, the lifetime of the guest wallet for any given user will last until they clear their browser storage.
82+
83+
You can try out Guest Mode [on our playground.](https://playground.thirdweb.com/connect/sign-in/button)

packages/thirdweb/src/wallets/in-app/web/ecosystem.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ import { createInAppWallet } from "../core/wallet/in-app-core.js";
2020
* - LINE
2121
* - X
2222
* - Farcaster
23+
* - Twitch
24+
* - Coinbase
25+
* - Steam
2326
*
2427
* Can also be configured to use Account Abstraction to directly connect to a ERC4337 smart account based on those authentication methods.
2528
*

packages/thirdweb/src/wallets/in-app/web/in-app.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import { createInAppWallet } from "../core/wallet/in-app-core.js";
2020
* - LINE
2121
* - X
2222
* - Farcaster
23+
* - Twitch
24+
* - Steam
2325
*
2426
* Can also be configured to use Account Abstraction to directly connect to a ERC4337 smart account based on those authentication methods.
2527
*

0 commit comments

Comments
 (0)