You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Handle closing the frame and opening external URLs safely
3
+
description: Handle external navigation and URL interactions safely across clients
4
4
---
5
5
6
-
Sdk options for external links
6
+
When building Mini Apps, proper link handling is crucial for providing a consistent user experience across different clients. This guide outlines best practices for external navigation and URL interactions.
7
7
8
+
## Core Principles
8
9
9
-
Deep links coming soon
10
+
### Use SDK Actions for Cross-Client Compatibility
10
11
12
+
**Always use official SDK functions instead of static URLs.** Static URLs can break cross-client compatibility and may leave users unable to complete actions in your Mini App.
13
+
14
+
<Warning>
15
+
Avoid using direct HTML links (`<a href="">`, `<Link href="">`) or static URLs in your Mini App. These approaches don't work consistently across different clients and can create poor user experiences.
16
+
</Warning>
17
+
18
+
## External Navigation
19
+
20
+
### Opening External URLs
21
+
22
+
Use `sdk.actions.openUrl()` to safely open external websites in the client's in-app browser:
23
+
24
+
```javascript
25
+
import { sdk } from'@farcaster/frame-sdk';
26
+
27
+
// ✅ Correct: Use SDK action
28
+
constopenExternalSite= () => {
29
+
sdk.actions.openUrl('https://example.com');
30
+
};
31
+
32
+
// ❌ Incorrect: Direct HTML link
33
+
// <a href="https://example.com">Visit Site</a>
34
+
```
35
+
36
+
### Composing Casts
37
+
38
+
Use `sdk.actions.composeCast()` instead of composer intent URLs:
| Farcaster-specific deeplinks | Use appropriate SDK action |
153
+
| Direct profile links | Use SDK actions for profile navigation when available |
154
+
155
+
## Future Considerations
156
+
157
+
While deeplinks are not currently supported, they are on the roadmap. When they become available, this documentation will be updated with specific implementation guidance. In the meantime, continue using SDK actions for the most reliable cross-client experience.
Copy file name to clipboardExpand all lines: docs/mini-apps/growth/optimize-onboarding.mdx
+42-23Lines changed: 42 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,74 +5,93 @@ description: Reduce friction with wallet‑optional flows and clear value moment
5
5
6
6
Optimize your onboarding flow to increase user engagement and retention. This guide outlines the best practices that will keep your users in-app and engaged.
7
7
8
-
### Goals
8
+
### Overview
9
9
10
-
- Make first interaction instant and non-blocking
11
-
- Authenticate only when a backend requires it; defer prompts until needed
10
+
Deliver value instantly and avoid blocking actions.
11
+
12
+
- Make the first interaction instant and non-blocking
13
+
- Authenticate only when required for security purposes and defer prompts until necessary
12
14
- Prefer the built-in Base Account; only offer connect/switch for alternate wallets, never gating
13
15
- Use progressive disclosure tied to intent (buy, post, personalize)
14
-
- Keep users in-app with SDK actions; avoid fragile deeplinks
16
+
- Keep users in-app with [SDK actions for links](/mini-apps/features/links); avoid fragile static urls
15
17
16
18
### Recommended onboarding flow
17
19
18
20
<Steps>
19
-
<Steptitle="First render (no prompts)">
21
+
<Steptitle="First render">
20
22
- Show immediate value (demo content, sample state, or read-only mode)
21
-
-Use Mini App `context` of user profile to instantly personalize
22
-
-Primary CTA leads to a meaningful action; no upfront login/connect dialogs
23
+
-Personalize instantly with [`context`](/mini-apps/technical-reference/minikit/provider-and-initialization) of the user's profile to instantly personalize
24
+
-Display one clear CTA that leads to a meaningful action (e.g. "Post a message", "Buy a token", "Follow a user")
23
25
</Step>
24
26
25
27
<Steptitle="User initiates a protected action">
26
-
-Backend needed: trigger Sign In with Farcaster (SIWF) / Quick Auth at this moment only
27
-
-Onchain action: use the Base Account automatically; no explicit wallet connect flow
28
+
-Trigger Sign In with Farcaster (SIWF) / Quick Auth only when needed per [Authentication](/mini-apps/features/Authentication)
29
+
-For onchain actions, use the Base Account automatically. Eliminate explicit wallet connect flows
28
30
- Alternate wallets: offer a non-blocking connect/switch option without gating exploration
29
31
</Step>
30
32
31
33
<Steptitle="Celebrate and amplify">
32
-
- After success, prompt social actions via SDK (e.g., compose cast, view profile)
33
-
- Offer next step: save progress, follow, or share
34
+
- After success, prompt social actions via [SDK actions](/mini-apps/features/links) and [Sharing & Social Graph](/mini-apps/features/sharing-and-social-graph)
35
+
- Offer next step: save, follow, or share — optimize with [Search & Discovery](/mini-apps/features/search-and-discovery)
34
36
</Step>
35
37
</Steps>
36
38
37
39
### UX patterns that work
38
40
41
+
<Tip>
39
42
- Progressive prompts: ask only when needed (buy, post, personalize)
40
43
- Clear copy: explain why you’re asking ("Sign in to save your score")
44
+
</Tip>
45
+
41
46
- One-time deep link (Connect Account users): if SIWF requires a one-time Farcaster link to register auth address, message it as a quick, one-time setup and return the user seamlessly
42
47
- Friendly fallbacks: if auth is skipped or fails, allow continued browsing in read-only mode
43
48
44
49
### Authentication and wallet guidance
45
50
46
-
- Authentication
47
-
- Only when your backend needs a verified user
48
-
- Use SIWF/Quick Auth to issue a session (JWT) when required
49
-
- Do not treat Mini App context as primary auth (it can be spoofed)
0 commit comments