Cointime

Download App
iOS & Android

Frog, Framework for Farcaster Frames

From paradigm by Achal Srinivasan, Georgios Konstantopoulos, awkweb, jxom

Frog is a toolkit for building Frames on Farcaster, a decentralized social network. It lets you create high-performance frames with a few lines of code and deploy it to the infrastructure of your choice. Start by using the documentation or contributing to the code today.

Frog was created as part of the collaboration between Paradigm and Wevm. Our teams see this as a natural extension to the work we're doing building open source tooling like Wagmi, Viem, Reth, Foundry, and others.

We are excited about the future of Frames, a programmable primitive for social apps created by the Farcaster team, and believe it deserves a world-class developer experience.

What are Frames?

Farcaster is a Twitter-like social network, and Frames let developers turn posts ("casts") into interactive elements. It's easy to turn a static post into a dynamic shopping or minting experience in your feed.

Frames turn any cast into an embedded interactive app in a Farcaster client such as Warpcast, redefining how content is viewed, engaged, and shared on social media. Frames are made possible by extending existing patterns defined by the Open Graph protocol, enabling them to be transformed into interactive experiences. With the inception of a new meta paradigm of "interactive social rich objects" to form embedded social user interfaces, the need for a first-class abstraction to enable developers to build high-quality, lightweight, and performant frames without compromising on user and developer experience becomes evident.

What is Frog?

Frog is a framework for Farcaster Frames that enables developers to build high quality, performant, and lightweight frames in just a few blocks of code. Frog comes with a built-in debugger, with live reloading, allowing developers to have a tight feedback loop between their code and frame interface.

See a full demo below.

Integrated on top of Hono, a tiny & fast JavaScript web framework, consumers can use JSX to build frames and integrate it onto any platform or runtime such as: Cloudflare, Vercel, Next.js, Bun, etc.

Essentially, Frog has no vendor lock-in – it can run on any deployment target that supports a JavaScript runtime.

Here is an example “1-file frame”, built on Frog, which you can run via bun run index.ts, and it’ll open a Frame API on localhost:3000, with the debugger accessible under the /dev route. Try it out! It’s that simple, bun install frog.

What makes Frog special?

Devtools are our bread and butter, so we strived to provide a fast, minimal, and feature-rich developer experience.

Here are some reasons why we are excited about in Frog today:

  • Local feature-rich debugger: A local debugger with automatic live reload, build your frames with instant feedback.
  • State Management: A first-class abstraction for state management is achieved through "state derivation" – we can use the deriveState function to derive state for the frame based on state from the previous frame.
  • Connect to Actions: Frog makes it intuitive to connect Frames together with a concept called Actions – instantiate a frame route via app.frame, and then connect it by adding an action path property to your dependent frame.
  • Deploy anywhere: No vendor lock-in – deploy to any JavaScript runtime or framework (Bun, Node.js, Deno, Next.js, Cloudflare Workers, Vercel Edge Runtime, etc).
  • Secure frames: Verification of frame messages is enabled by default provided you supply a Hub API URL (you can also use ours), and ability to sign & verify derived frame state via JSON web signatures.
  • Built on top of Hono: Hono is a super fast and lightweight JavaScript web framework with compelling benchmarks.
  • Build with JSX: Build and visualize frames in code with JSX, a familiar pragma known to React developers.

Why did you build Frog?

We built Frog to 100x the developer experience of writing Farcaster Frames. At a high level, to build a frame, your webpage must provide a set of frame specific meta tags in the document’s block. Akin to Open Graph meta tags, these tags are prefixed with fc:frame:.

To build highly immersive frame applications, with only a set of server-rendered meta tags, presents a unique set of constraints to developers:

  1. There is no concept of client-side reactivity, which makes state management harder than what we’re accustomed to.
  2. There are restrictions on the sizes of fc:frame:* tags.
  3. There are restrictions on the behavior of the fc:frame:* tags (i.e. only 4 buttons, initial state must be empty, etc).
  4. There are security concerns to consider when building frames.
  5. Frame UI (i.e. frame endpoint) and OpenGraph Image UI (i.e. image endpoint) are decoupled.

It can be non-trivial to intuitively build a high-quality & performant frame application in a low-level (vanilla) setting without compromising on these constraints. We built Frog so that we could enable developers to rapidly build frames without thinking about these types of constraints. The framework handles everything under-the-hood so you can build any type of frame you imagine.

We also observed that the local Frame development experience could be improved.

  • The Warpcast Frame Validator is a great tool, especially for validating frames which have been deployed (as the name implies!), however it introduces some challenges for developing frames locally. This is mainly because you can’t insert your locally hosted frame URLs in the validator.
  • Every frame route in Frog comes with a /dev-suffixed endpoint, which consists of the frame devtools – a local debugger for your frames with automatic live-reload. Frog Devtools isn’t intended to replace the Warpcast Frame Validator, but is designed to work alongside it.

Most frames that exist today are culturally built with React & Next.js. This is fine, but we believe that:

  1. You don’t need the entire React API to build a frame – only the JSX pragma.
  2. You shouldn’t have to build multiple Next.js routes/pages to build a frame, nor should you have a sense of vendor lock-in – a frame should exist in a singular module (file), to make it more approachable for contributors, and easy to maintain.

A final observation we have noted is that a lot of frames contain full HTML documents that contain a rich <body> block on top of their frame meta tags. As frames do not utilize the document body at all, this causes a hindrance on frame-load performance. Ideally, frame endpoints should only contain their meta tags – if a user is coming from a browser, we can 302 redirect them to the correct web page accordingly.

What is next?

Frog was built in just three weeks, and Farcaster Frames have existed for about a month. We are still very early in our development journey. We are beyond excited to continue the collaboration between Paradigm and Wevm, and work closely with the Farcaster team on future updates to the Frame specification – ensuring that Frog is closely synced with the latest features. The next thing to be on the lookout for is the new “Transactions” feature for frames added to Frog.

Beyond that, we are excited to:

  1. Pull out the local debugger into a hosted environment for users to play around with any live & hosted frames (whether they are built on Frog or not).
  2. Build Framehouse, a tool to audit your frame for performance, size, and best practices (akin to Lighthouse).

Frog 🐸 is open source (MIT), available for free on Github, along with extensive documentation (built on Vocs!) and a support chatroom. We invite developers to use Frog to build Frames, contribute the codebase, or submit bug reports & feature requests.

If all of this sounds interesting to you, please reach out to: GeorgiosAchalTom, or Jake.

Have ideas on what we should prioritize? Let us know! We’d be thrilled to hear what you are building, or to collaborate on improving Frog and the Farcaster protocol.

Comments

All Comments

Recommended for you

  • BTC Surpasses $71,000

    Market data shows that BTC has surpassed $71,000, currently priced at $71,007.05, with a 24-hour decline of 2.81%. The market is experiencing significant volatility, so please ensure proper risk management.

  • BTC Falls Below $71,000

    Market data shows that BTC has fallen below $71,000, currently priced at $70,974.17, with a 24-hour decline of 2.69%. The market is experiencing significant volatility, so please ensure proper risk management.

  • Trump: U.S. Navy to Begin Blockade of Strait of Hormuz

    U.S. President Trump: The talks between the U.S. and Iran are going well, with most topics reaching a consensus, but the only truly important nuclear issue has not been resolved. Effective immediately, the U.S. Navy will begin a blockade of any vessels attempting to enter or exit the Strait of Hormuz. I have also instructed the U.S. Navy to search and seize every ship in international waters that has paid a toll to Iran.

  • U.S. Negotiation Team Members Have All Left Pakistan

    On April 12, a U.S. official stated that after the U.S.-Iran talks concluded, all members of the U.S. negotiation team have left Pakistan. The official noted that personnel, including Witkoff, Kushner, and the technical team, did not remain in the capital of Pakistan, indicating that both sides will not immediately resume direct negotiations. Earlier that day, Vance mentioned at a press conference in Islamabad that the U.S. has not reached a consensus with Iran and will return to the United States. The negotiations between the U.S. and Iran in Islamabad ended on the 12th without any agreement. The Iranian side stated that the talks were conducted in an atmosphere of 'distrust and suspicion,' with both sides having differences on two or three key issues. The U.S. side claimed that it had clearly outlined its 'red lines,' but the Iranian side did not accept the U.S. conditions.

  • ETH Falls Below $2200

    Market data shows that ETH has fallen below $2200, currently priced at $2195.81, with a 24-hour decline of 1.97%. The market is experiencing significant volatility, so please ensure proper risk management.

  • BTC Surpasses $73,000

    Market data shows that BTC has surpassed $73,000, currently priced at $73,010, with a 24-hour increase of 3.3%. The market is experiencing significant volatility, so please ensure proper risk management.

  • Iranian Armed Forces Declare Readiness to Fire at Any Time

    On April 10, a spokesperson for the Central Headquarters of the Iranian Armed Forces, Khatam al-Anbiya, stated that due to the repeated breaches of trust by the United States and Israel, the Iranian Armed Forces remain on full alert and are ready to fire at any time. (Xinhua News Agency)

  • U.S. Core CPI in March Increases 2.6% Year-on-Year, Estimated at 2.7%

    On April 10, it was reported that the U.S. core consumer price index (CPI) increased by 2.6% year-on-year in March, slightly below the estimated 2.7%, and up from the previous value of 2.5%. Month-on-month, it rose by 0.2%, compared to an estimate of 0.3%.

  • US March CPI Increases 3.3% Year-on-Year, Highest Since May 2024

    On April 10, it was reported that the US Consumer Price Index (CPI) for March increased by 3.3% year-on-year, marking the highest level since May 2024. The forecast was 3.4%, while the previous value was 2.4%. The seasonally adjusted CPI for March rose by 0.9% month-on-month, matching expectations of 0.9%, compared to the previous value of 0.30%.

  • Fed's Daly: Likelihood of Rate Hike Lower than Rate Cut or Holding Steady

    Fed's Daly stated that if the Iran conflict is resolved quickly and oil prices decline, a rate cut is 'not out of the question.' If inflation remains above expectations for an extended period, we will remain cautious until we are confident that the inflation issue has been addressed. We had work to do on inflation before the oil price shock; now, this work simply requires more time. The likelihood of a rate hike is considered lower than that of a rate cut or maintaining the current rate.