Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

viewCast

Open a specific cast in the Farcaster client. This navigates the user to view the full cast with its replies and reactions.

Usage

import { sdk } from '@farcaster/miniapp-sdk'
 
await sdk.actions.viewCast({ 
  hash: castHash,
})

Parameters

hash

  • Type: string

The hash of the cast to view. This should be a valid cast hash from the Farcaster protocol.

authorUsername (optional)

  • Type: string

The username of the cast's author.

close (optional)

  • Type: boolean

Whether the app should be closed when this action is called. If true, the app will be closed after opening the cast view.

Return Value

Promise<void> - This action does not return a value. It triggers navigation to the cast view in the Farcaster client.

// View a specific cast
await sdk.actions.viewCast({
  hash: "0x6a112e2d35e2d2008e25dd29811e8769d1edd9ca",
});
 
// View a cast and close the mini app
await sdk.actions.viewCast({
  hash: "0x6a112e2d35e2d2008e25dd29811e8769d1edd9ca",
  close: true,
});
 
// View a cast by author and hash
await sdk.actions.viewCast({
  hash: "0x78c086e5",
  authorUsername: "six",
});