From 3dbcf77fe3df4328898593740162627e3ccfccca Mon Sep 17 00:00:00 2001 From: Ian Mukherjee Date: Thu, 3 Oct 2024 11:46:18 -0400 Subject: [PATCH 1/3] Add guest mode documentation Signed-off-by: Ian Mukherjee --- .../guides/link-multiple-profiles/page.mdx | 1 + .../guides/retrieve-linked-profiles/page.mdx | 1 + apps/portal/src/app/connect/sidebar.tsx | 4 ++ .../sign-in/methods/guest-mode/page.mdx | 58 +++++++++++++++++++ 4 files changed, 64 insertions(+) create mode 100644 apps/portal/src/app/connect/sign-in/methods/guest-mode/page.mdx diff --git a/apps/portal/src/app/connect/in-app-wallet/guides/link-multiple-profiles/page.mdx b/apps/portal/src/app/connect/in-app-wallet/guides/link-multiple-profiles/page.mdx index cebb521998d..d7638408a8c 100644 --- a/apps/portal/src/app/connect/in-app-wallet/guides/link-multiple-profiles/page.mdx +++ b/apps/portal/src/app/connect/in-app-wallet/guides/link-multiple-profiles/page.mdx @@ -84,6 +84,7 @@ Note that the `email` field above will differ based on the profile type. We list | Strategy | Type | `details` Field | | ------------- | ----------------- | --------------- | +| Guest | `"guest"` | `id` | | Email | `"email"` | `email` | | Phone | `"phone"` | `phone` | | Passkey | `"passkey"` | `id` | diff --git a/apps/portal/src/app/connect/in-app-wallet/guides/retrieve-linked-profiles/page.mdx b/apps/portal/src/app/connect/in-app-wallet/guides/retrieve-linked-profiles/page.mdx index 9b6f4a1fa20..686ca740cbc 100644 --- a/apps/portal/src/app/connect/in-app-wallet/guides/retrieve-linked-profiles/page.mdx +++ b/apps/portal/src/app/connect/in-app-wallet/guides/retrieve-linked-profiles/page.mdx @@ -29,6 +29,7 @@ Note that the `email` field above will differ based on the profile type. We list | Strategy | Type | `details` Field | | ------------- | ----------------- | --------------- | +| Guest | `"guest"` | `id` | | Email | `"email"` | `email` | | Phone | `"phone"` | `phone` | | Passkey | `"passkey"` | `id` | diff --git a/apps/portal/src/app/connect/sidebar.tsx b/apps/portal/src/app/connect/sidebar.tsx index f300bbc200f..4d47722ab49 100644 --- a/apps/portal/src/app/connect/sidebar.tsx +++ b/apps/portal/src/app/connect/sidebar.tsx @@ -132,6 +132,10 @@ export const sidebar: SideBar = { name: "External Wallets", href: `${connectSlug}/methods/external-wallets`, }, + { + name: "Guest Mode", + href: `${connectSlug}/methods/guest-mode`, + }, ], }, { diff --git a/apps/portal/src/app/connect/sign-in/methods/guest-mode/page.mdx b/apps/portal/src/app/connect/sign-in/methods/guest-mode/page.mdx new file mode 100644 index 00000000000..12b8c6b3e1c --- /dev/null +++ b/apps/portal/src/app/connect/sign-in/methods/guest-mode/page.mdx @@ -0,0 +1,58 @@ +import { createMetadata } from "@doc"; + +export const metadata = createMetadata({ + image: { + title: "Guest Mode", + icon: "wallets", + }, + title: "Guest Mode", + description: + "Learn how to get users started in your app without requiring sign-in.", +}); + +# Guest Mode + +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. + +## With `inAppWallet` + +```tsx +import { inAppWallet } from "thirdweb/wallets"; + +const wallet = inAppWallet(); + +// Create the temporary guest account +const account = await wallet.connect({ + client, + strategy: "guest", +}); +``` + +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. + +```tsx +import { linkProfile } from "thirdweb/wallets"; + +await linkProfile(wallet, { strategy: "google" }); +``` + +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. + +## With `ConnectButton` + +```tsx +import { ConnectButton } from "thirdweb/react"; +import { createWallet } from "thirdweb/wallets"; + +; +``` + +You can try out Guest Mode [on our playground.](https://playground.thirdweb.com/connect/sign-in/button) From 223d105ce612a65f7ec7c447d7c2a8487546b92f Mon Sep 17 00:00:00 2001 From: Joaquim Verges Date: Fri, 4 Oct 2024 21:43:08 +1300 Subject: [PATCH 2/3] Update page.mdx --- apps/portal/src/app/connect/sign-in/methods/guest-mode/page.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/portal/src/app/connect/sign-in/methods/guest-mode/page.mdx b/apps/portal/src/app/connect/sign-in/methods/guest-mode/page.mdx index 12b8c6b3e1c..0828eee83e6 100644 --- a/apps/portal/src/app/connect/sign-in/methods/guest-mode/page.mdx +++ b/apps/portal/src/app/connect/sign-in/methods/guest-mode/page.mdx @@ -42,7 +42,7 @@ Your user can now access this same wallet with their Google account. Until the u ```tsx import { ConnectButton } from "thirdweb/react"; -import { createWallet } from "thirdweb/wallets"; +import { inAppWallet } from "thirdweb/wallets"; Date: Fri, 4 Oct 2024 21:43:57 +1300 Subject: [PATCH 3/3] Update page.mdx --- apps/portal/src/app/connect/sign-in/methods/guest-mode/page.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/portal/src/app/connect/sign-in/methods/guest-mode/page.mdx b/apps/portal/src/app/connect/sign-in/methods/guest-mode/page.mdx index 0828eee83e6..8beaf4d819a 100644 --- a/apps/portal/src/app/connect/sign-in/methods/guest-mode/page.mdx +++ b/apps/portal/src/app/connect/sign-in/methods/guest-mode/page.mdx @@ -46,7 +46,7 @@ import { inAppWallet } from "thirdweb/wallets";