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

  • Spot Gold Declines by 2%

    On May 27, spot gold saw its intraday decline widen to 2%, trading at $4,416.32 per ounce.

  • Analysis: Bitcoin May Continue 'May Sell-off', Historical Signals Indicate About 10% Short-term Correction Risk

    Bitcoin has been weakening for a month, retreating after being blocked near $83,000, and is currently moving towards a decline in May, which the market views as a classic seasonal signal of 'May sell-off' re-emerging. Historical data shows that Bitcoin's average return one month after a 'red May' is approximately -10%, and about -3.3% over three months, with short-term trends typically continuing to weaken; based on historical averages, the price could fall to around the $68,200 range. Analysis indicates that 'red May' in a bear market structure is often more destructive; however, Bitcoin's average increase over the six months following 'red May' can reach about +139%, and even after excluding anomalous years, it remains around +12.9%, indicating that the long-term trend has not been disrupted by seasonal signals.

  • U.S. Stocks Open Higher with All Three Major Indices Up

    U.S. stocks opened higher, with all three major indices rising: the Dow Jones increased by 0.18%, the S&P 500 rose by 0.07%, and the Nasdaq gained 0.17%. Micron Technology (MU.O) surged by 6.6% after UBS significantly raised its target price to $162.50.

  • BTC Falls Below $75,000

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

  • UCarpay CARDPIE: Connecting Digital Assets with Global Cross border Payment Channels

    As global demand for digital asset circulation and cross-border payments continues to grow, users are increasingly facing challenges such as limited access to traditional payment channels, high foreign exchange costs, and fragmented card management. In response to these market needs, CARDPIE, a professional USDT card aggregation platform, is building a seamless bridge between digital assets and global spending by delivering a comprehensive stablecoin payment solution for both individuals and enterprises.

  • Astarter releases multi chain expansion roadmap signal plan to extend to EVM and Solana ecosystems

    The Cardano ecological infrastructure project Astarter has released a multi chain expansion roadmap signal in public materials, gradually extending its clearing layer infrastructure to mainstream public chain ecosystems such as EVM and Solana. The Astarter team believes that the Al Agent economy and DePIN network essentially run across chains, and the execution layer that only anchors a single public chain is structurally limited. Multi chain expansion is a crucial step for Astarter to reach all AI agent economic activities. The specific deployment goals and timeline for the second public chain will be announced in subsequent announcements. Cardano will still be retained as the basic anchor chain.

  • US Spot Ethereum ETF Sees Net Outflow of $35.1 Million Yesterday

    On May 27, according to monitoring data from Farside Investors, the US spot Ethereum ETF experienced a net outflow of $35.1 million yesterday.

  • US Spot Bitcoin ETF Sees Net Outflow of $333.61 Million Yesterday

    On May 27, according to monitoring by Trader T, the US spot Bitcoin ETF experienced a net outflow of $333.61 million yesterday.

  • Supreme Court's Liu Guixiang: In-depth Study of Judging Rules for New Cases like Virtual Currency and Cross-Border Finance

    On May 27, Liu Guixiang, a deputy-level full-time member of the Supreme People's Court Judicial Committee and a second-level justice, stated at a press conference held by the State Council Information Office that the people's courts will legally support compliant and lawful financial innovation models, combat financial illegal activities, and conduct in-depth research on the judging rules for new cases such as virtual currency and cross-border finance.