đŸĨĒAirstack Frog Middleware

Build your Farcaster Frames with Airstack frog middleware. Seamlessly integrate Farcaster data into your Frames easily.

The Airstack Frog Middleware is available as a community-built middleware and can be easily incorporated into any Frog app by installing the Airstack Frames SDK. (The Airstack Frog Middleware can also be accessed via the Airstack Frog Recipes)

Farcaster Data Middleware

You can use the farcasterData middleware to seamlessly incorporate the interactor's Farcaster data directly into your Farcaster Frames. Simply specify the Farcaster data to retrieve in the features field and integrate the middleware into the desired route for data access:

import { farcasterDataFrogMiddleware } from "@airstack/frames";

const farcasterDataMiddleware = farcasterDataFrogMiddleware({
  features: {
    userDetails: {},
  },
  env: "dev",
});

app.frame(
  "/",
  // Add Farcaster Data Middleware to the routes that need to access
  // User's Farcaster data
  farcasterDataMiddleware,
  async function (c) {
    const { status } = c;
    if (status === "response") console.log(c.var);
    c.res({});
  }
);

Allow List Middleware

Enhance your Farcaster Frames with user's onchain data using the allowList middleware from Airstack Frog Recipes. Effortlessly set up by specifying your criteria in the allowListCriteria field and incorporating the middleware into the route where you wish to access the data:

import { allowList } from "@airstack/frames";

const allowListMiddleware = allowList({
  allowListCriteria: {
    numberOfFollowersOnFarcaster: 100,
    isFollowingOnFarcaster: [2602],
  },
});

app.frame("/", allowListMiddleware, async function (c) {
  const { status } = c;
  if (status === "response") console.log(c.var);
  c.res({});
});

Developer Support

If you have any questions or need help regarding building Farcaster Frames with Airstack Frog Middleware, please join our Airstack's Telegram group.

More Resources

Last updated