diff --git a/docs/docs.json b/docs/docs.json index 8982b2a8..02d56881 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -496,7 +496,8 @@ "pages": [ "mini-apps/troubleshooting/common-issues", "mini-apps/troubleshooting/base-app-compatibility", - "mini-apps/troubleshooting/how-search-works" + "mini-apps/troubleshooting/how-search-works", + "mini-apps/troubleshooting/testing" ] }, { diff --git a/docs/images/miniapps/auth-flowchart.png b/docs/images/miniapps/auth-flowchart.png new file mode 100644 index 00000000..b6afcbcb Binary files /dev/null and b/docs/images/miniapps/auth-flowchart.png differ diff --git a/docs/mini-apps/core-concepts/authentication.mdx b/docs/mini-apps/core-concepts/authentication.mdx index 521559ad..e2e3c0ee 100644 --- a/docs/mini-apps/core-concepts/authentication.mdx +++ b/docs/mini-apps/core-concepts/authentication.mdx @@ -1,17 +1,54 @@ --- title: Authentication -description: Quick Auth provides instant authentication by leveraging Farcaster's identity system - no passwords, email verification, or complex OAuth flows required. +description: Instantly recognize users, personalize their experience, and securely access wallet or social graph data. --- + +## Choosing An Authentication Method +Users in the Base app are authenticated with passkey account using [Sign in with Ethereum](https://docs.login.xyz/) (SIWE) or their Farcaster account using [Sign in With Farcaster](https://docs.farcaster.xyz/developers/siwf/). + +When deciding between SIWE and SIWF, the core question is whether your app depends on Farcaster’s social context or must work outside Farcaster clients. + +![auth-flow-chart](/images/miniapps/auth-flowchart.png) + +#### Sending Notifications + +If your app plans to send notifications to users, you must use SIWF. +Notifications require a Farcaster identity (FID), which is only available through Sign-in With Farcaster. + +You can still support SIWE if your app also needs a universal wallet-based identity, but SIWF is required for any notification functionality. + + +#### App location + +If your app will be used on the open web, other wallets, or standalone mobile apps, use SIWE as your primary authentication. + +You can still offer SIWF when the user arrives from a Farcaster client. + + +#### Utilizing Farcaster Social Graph + +If your app does not rely on followers, FIDs, casts, or social graph logic, use SIWE and optionally support SIWF for enhanced social features. + +If your app does rely on that data, consider if you are willing to require users to have a Farcaster account. + + +For a complete guide on authenticating users with SIWE, see our [Authenticate Users](/base-account/guides/authenticate-users#add-the-base-sign-in-with-base-button) guide using Sign in with Base. + + +## Quick Auth + +Quick Auth provides instant authentication by leveraging Farcaster's identity system - no passwords, email verification, or complex OAuth flows required. + When Quick Auth is called: * The user authenticates with a signature * The SDK returns a JWT that your backend verifies to confirm the user's identity * The backend returns trusted data that can be used for sensitive actions - + This differs from the [Context API](/mini-apps/core-concepts/context), which provides instant access to user information without authentication but cannot be trusted for sensitive operations. - + ## Implementation diff --git a/docs/mini-apps/troubleshooting/testing.mdx b/docs/mini-apps/troubleshooting/testing.mdx new file mode 100644 index 00000000..f1f3591e --- /dev/null +++ b/docs/mini-apps/troubleshooting/testing.mdx @@ -0,0 +1,77 @@ +--- +title: Test Your App +description: Confidently test your app before going live in the Base app +--- + +Testing your mini app before launch ensures it functions correctly, displays properly, and provides the user experience you intended. You can test your app using a few different methods, each suited for different stages of development and testing needs. The only requirement is to have your mini app publicly accessible URL via `https://`. + +## Base Build Preview Tool + +Preview and debug your mini app to ensure it displays correctly in the Base App using the [Preview Tool.](https://www.base.dev/preview) + + +Your browser's console won't show Base-specific logs. Base.dev console provides logs specific to how your mini app works within the Base app, including user context and Base app-specific functionality. + + +### Best for + + * Validating correctness of manifest files and required fields +* Using an interactive console for viewing logs +* Signing your app's manifest + +### Not ideal for testing +* Full look and feel on your app in Base app +* Chat and Base app specific functionality +* User context functionality + +### Steps + +1. Navigate to [Base.dev/preview](https://www.base.dev/preview) +2. Log in using your Base app account +3. Paste your app's url in the field +4. Click `Submit` + +## Base app + +Preview how your app would function directly using the Base App. + +### Best for + +* Keeping your app private from the feed +* Preview in-app functionality (UX) +* Chat-based applications +* Apps that require user and Base app context + +### Not ideal for testing + +* Logs +* Validating correctness of manifest file + +### Steps + +1. Enable Developer Mode: **Open Base App > Privacy & Security > toggle Developer Mode** +2. Open preview: **Settings > Developer > Preview** +3. Enter the URL of your mini app +4. Click `Preview` + +## In-feed and DMs + +Preview your app by posting the URL directly in the Base app feed or by sending a DM to another user. + +### Best for + +* Requesting feedback from the public +* Apps that require user and Base app context +* Testing edge cases + +### Not ideal for + +* Viewing logs +* Validating correctness of manifest file + +### Steps + +1. Open [Base app](https://join.base.app/) +2. Share your mini app URL by: + - Posting it in the Base app feed, or + - Sending it in a DM to someone or a group chat