Skip to main content
Defined in @coinbase/onchainkit
Opens the native cast composer with prefilled text and embeds. Essential for viral growth and social sharing within Mini Apps.

Returns

(params: ComposeCastParams) => void
Function that opens the cast composer with specified content.

Strategic Sharing Patterns

Achievement Moments

Share at moments of user accomplishment:
examples/AchievementMoments.tsx

Viral Growth Mechanics

Design shares that encourage interaction:
examples/ViralGrowthMechanics.tsx

Content Personalization

Customize shares based on user activity:
examples/ContentPersonalization.tsx

Best Practices

Text Content

  • Keep it concise: Farcaster has character limits
  • Include emotional context: Use emojis and excitement
  • Add clear value: Explain why others should care
  • Include call-to-action: “Try it yourself”, “Beat my score”

Embed Strategy

  • Always include your app URL for discoverability
  • Add relevant media: Images, videos, other content
  • Test embed rendering: Ensure metadata displays correctly

Timing Optimization

  • Post-achievement: When users feel accomplished
  • Social moments: When friends are likely online
  • Value demonstration: After showing app benefits
  • Avoid interruption: Don’t break user flow
The composer opens in a native overlay or new window depending on the client. Users can modify the text before posting, so don’t rely on exact text for tracking. Use URL parameters or unique embeds for attribution tracking.
useComposeCast is one of the most powerful hooks for viral growth. Strategic implementation of sharing at the right moments can significantly increase your Mini App’s reach and user acquisition.