Content pfp
Content
@
0 reply
0 recast
0 reaction

jon pfp
jon
@sweetleaf.eth
Building a frame in Frog, I would like to take user input in a frame, use that in an API call, and pass that response to another page in the frame. What's the proper way to accomplish this? I see things in docs for onchain actions like `app.transaction` but nothing for arbitrary API calls.
2 replies
1 recast
3 reactions

jon pfp
jon
@sweetleaf.eth
@horsefacts.eth @stephancill @fiveoutofnine.eth know of any docs or opensource frames that might be helpful here? Have a good idea of how to go about it, but stuck on implementation.
2 replies
0 recast
1 reaction

Stephan pfp
Stephan
@stephancill
If you mean you want to take user input do req, return a frame, and have the api response data available when the user next presses a button, then depending on data length you could store it in 1. the button target url params (<200b) 2. frame state (up to 4kb) 3. kv store like vercel/kv or cloudflare kv (arbitrary)
2 replies
0 recast
1 reaction

Stephan pfp
Stephan
@stephancill
I haven’t used frog for a project but heres some frames.js implementations for 1 and 3 1. https://github.com/stephancill/manage-ens-frame/blob/master/src/app/frames/check-names/route.tsx#L93 3. https://github.com/stephancill/frameswap/blob/master/app/frames/buy/route.tsx#L133 (async call, loading screen)
2 replies
0 recast
1 reaction

jon pfp
jon
@sweetleaf.eth
That answers my other question about UX, going with loading screen. Really appreciate it, I'll check these out!
0 reply
0 recast
0 reaction