-
Notifications
You must be signed in to change notification settings - Fork 619
Add guest mode documentation #4910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+64
−0
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
apps/portal/src/app/connect/sign-in/methods/guest-mode/page.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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"; | ||
|
|
||
| <ConnectButton | ||
| wallets={[ | ||
| createWallet("inApp", { | ||
joaquim-verges marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| auth: { | ||
| options: ["google", "discord", "telegram", "email", "phone", "guest"], | ||
| }, | ||
| }), | ||
| ]} | ||
| />; | ||
| ``` | ||
|
|
||
| You can try out Guest Mode [on our playground.](https://playground.thirdweb.com/connect/sign-in/button) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.