wevm / frog

Framework for Farcaster Frames 🐸
https://frog.fm
Other
408 stars 94 forks source link

post_url too long, way to set it? #343

Closed 1dolinski closed 2 months ago

1dolinski commented 3 months ago

Describe the bug

Is there an attribute to set the post_url on the initial frame? Atm, one of my buttons that redirects the URL is long which errors out the post_url validation.

// We need to pass some context to the next frame to derive button values, state, etc.
      // Here, we are deriving two sets of "next frame state".
      // 1. For the INITIAL FRAME, we need to pass through the state as a search parameter
      //    due to Farcaster's constraints with the `fc:frame:state` tag. It must be empty
      //    for the initial frame.
      // 2. For SUBSEQUENT FRAMES, we can pass through the state as a serialized JSON object
      //    to the next frame via the `fc:frame:state` tag.
      const nextFrameStateSearch = toSearchParams({
        initialPath: context.initialPath,
        previousButtonValues: buttonValues,
      })

Link to Minimal Reproducible Example

No response

Steps To Reproduce

Frame with long url

// This is a long url
const sharePath = `https://warpcast.com/~/compose?embeds%5B%5D=${encodeURIComponent('shareUrl')}`

...
        intents: [
          <Button>Click</Button>,
          <Button.Redirect location={sharePath}>🔵 Share</Button.Redirect>,
        ],

Frog Version

latest

TypeScript Version

No response

Check existing issues

Anything else?

No response

dalechyn commented 2 months ago

Have you tried using Button.Link?

1dolinski commented 2 months ago

^ fixed it