Skip to content

Instantly share code, notes, and snippets.

import { Context, HonoRequest, Next } from "hono";
import { validateFramesPost } from "@xmtp/frames-validator";
export const xmtpSupport = async (c: Context, next: Next) => {
await next();
const isFrame = c.res.headers.get("content-type")?.includes("html");
if (!isFrame) return;
if (!(await isXMTP(c.req))) return;
@kuririn1
kuririn1 / middleware.ts
Created March 26, 2024 12:37
XMTP middleware for Frog
import { Context, Next } from "hono";
import { validateFramesPost } from "@xmtp/frames-validator";
export const xmtpSupport = async (c: Context, next: Next) => {
await next();
const isFrame = c.res.headers.get("content-type")?.includes("html");
if (!isFrame) return;
let html = await c.res.clone().text();