From b9e2fe1228f1a4fd412ccfaeb32ede50b212f5ab Mon Sep 17 00:00:00 2001 From: Soheima Date: Fri, 5 Sep 2025 20:37:22 +0200 Subject: [PATCH 1/3] upated link to minikit composeCast from links --- docs/mini-apps/features/links.mdx | 33 +++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/docs/mini-apps/features/links.mdx b/docs/mini-apps/features/links.mdx index ef7722d6..696c6f8e 100644 --- a/docs/mini-apps/features/links.mdx +++ b/docs/mini-apps/features/links.mdx @@ -22,7 +22,7 @@ Avoid using direct HTML links (``, ``) or static URLs i Use `sdk.actions.openUrl()` to safely open external websites in the client's in-app browser: ```typescript App.tsx -import { sdk } from '@@farcaster/miniapp-sdk'; +import { sdk } from '@farcaster/miniapp-sdk'; // Correct: Use SDK action const openExternalSite = () => { @@ -51,6 +51,30 @@ const shareContent = () => { // Incorrect: Composer intent URLs // window.open('https://farcaster.com/~/compose?text=...') ``` +Using MiniKit + +```tsx Share with App Embed +import { useComposeCast } from '@coinbase/onchainkit/minikit'; + +export default function ShareAppButton() { + const { composeCast } = useComposeCast(); + + const handleShareApp = () => { + composeCast({ + text: 'Check out this amazing Mini App!', + embeds: [window.location.href] + }); + }; + + return ( + + ); +} +``` +[Click here for more MiniKit examples](/mini-apps/technical-reference/minikit/hooks/useComposeCast) + ## Best Practices @@ -67,7 +91,7 @@ Before implementing any navigation or linking functionality: When using features that may not be supported in all clients: ```javascript App.tsx -import { sdk } from '@@farcaster/miniapp-sdk'; +import { sdk } from '@farcaster/miniapp-sdk'; const handleExternalLink = (url) => { try { @@ -79,6 +103,7 @@ const handleExternalLink = (url) => { }; ``` + ### 3. Avoid Client-Specific URLs Don't hardcode URLs specific to particular clients (like Warpcast URLs). Instead, use SDK actions that work across all supported clients. @@ -88,7 +113,7 @@ Don't hardcode URLs specific to particular clients (like Warpcast URLs). Instead ### Navigation Buttons ```javascript NavigationComponent.tsx -import { sdk } from '@@farcaster/miniapp-sdk'; +import { sdk } from '@farcaster/miniapp-sdk'; const NavigationComponent = () => { const handleExternalLink = () => { @@ -118,7 +143,7 @@ const NavigationComponent = () => { ### Conditional Navigation ```javascript ConditionalNavigation.tsx -import { sdk } from '@@farcaster/miniapp-sdk'; +import { sdk } from '@farcaster/miniapp-sdk'; const ConditionalNavigation = () => { const context = sdk.context; From e6ddce42d243504172c00113eef759c6f7996448 Mon Sep 17 00:00:00 2001 From: Soheima Date: Fri, 5 Sep 2025 20:39:21 +0200 Subject: [PATCH 2/3] upated link to demo --- docs/mini-apps/resources/resources.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/mini-apps/resources/resources.mdx b/docs/mini-apps/resources/resources.mdx index 29fc9419..79ea6ef8 100644 --- a/docs/mini-apps/resources/resources.mdx +++ b/docs/mini-apps/resources/resources.mdx @@ -71,7 +71,7 @@ Production-ready code repositories that you can clone and deploy immediately. A comprehensive showcase demonstrating the complete range of MiniKit capabilities and Base ecosystem integrations. From d94a9f256b76821d935f1f1007017ba985cdf260 Mon Sep 17 00:00:00 2001 From: Soheima Date: Fri, 5 Sep 2025 20:42:35 +0200 Subject: [PATCH 3/3] upated link to demo and removed --- docs/mini-apps/features/links.mdx | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/docs/mini-apps/features/links.mdx b/docs/mini-apps/features/links.mdx index 696c6f8e..94c51b20 100644 --- a/docs/mini-apps/features/links.mdx +++ b/docs/mini-apps/features/links.mdx @@ -51,30 +51,6 @@ const shareContent = () => { // Incorrect: Composer intent URLs // window.open('https://farcaster.com/~/compose?text=...') ``` -Using MiniKit - -```tsx Share with App Embed -import { useComposeCast } from '@coinbase/onchainkit/minikit'; - -export default function ShareAppButton() { - const { composeCast } = useComposeCast(); - - const handleShareApp = () => { - composeCast({ - text: 'Check out this amazing Mini App!', - embeds: [window.location.href] - }); - }; - - return ( - - ); -} -``` -[Click here for more MiniKit examples](/mini-apps/technical-reference/minikit/hooks/useComposeCast) - ## Best Practices