This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@xmtp/frames-validator
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

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)
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @xmtp/frames-validator

Weekly Downloads

2,001

Version

2.0.1

License

MIT

Unpacked Size

40.4 kB

Total Files

10

Last publish

Collaborators

  • fabriguespe
  • galligan
  • nick-xmtp
  • nplasterer-xmtp
  • saul-xmtp
  • xmtp-eng-robot