@xmtp/frames-validator
v2.0.1
Published
A validator for XMTP frames requests
Downloads
14,863
Keywords
Readme
Frames Validator
A set of tools for validating POST payloads from XMTP Frames
Usage
import { validateFramesPost } from "@xmtp/frames-validator"
export function handler(requestBody: any) {
// This is an XMTP payload
if (requestBody.untrustedData?.clientType === "xmtp") {
const { verifiedWalletAddress } = await validateFramesPost(requestBody)
return doSomethingWithWalletAddress(verifiedWalletAddress)
} else {
// This is a Farcaster POST payload
return doSomethingWithFarcasterPayload(requestBody)
}
}