diff --git a/.changeset/fifty-kiwis-taste.md b/.changeset/fifty-kiwis-taste.md new file mode 100644 index 00000000..ae7fd18b --- /dev/null +++ b/.changeset/fifty-kiwis-taste.md @@ -0,0 +1,16 @@ +--- +"frog": minor +--- + +Removed `frog` hub. Use `neynar` along with the `'NEYNAR_FROG_FM'` dev API key instead. + +```diff +import { Frog } from 'frog' +- import { frog } from 'frog/hubs' ++ import { neynar } from 'frog/hubs' + +export const app = new Frog({ +- hub: frog(), ++ hub: neynar({ apiKey: 'NEYNAR_FROG_FM' }), +}) +``` diff --git a/playground/src/index.tsx b/playground/src/index.tsx index 87844aab..0b2e8309 100644 --- a/playground/src/index.tsx +++ b/playground/src/index.tsx @@ -1,7 +1,7 @@ import { serveStatic } from '@hono/node-server/serve-static' import { Button, Frog, TextInput } from 'frog' import { devtools } from 'frog/dev' -import * as hubs from 'frog/hubs' +import { neynar } from 'frog/hubs' import { Box, Heading, vars } from './ui.js' import { app as castActionApp } from './castAction.js' @@ -15,7 +15,7 @@ import { app as transactionApp } from './transaction.js' import { app as uiSystemApp } from './ui-system.js' export const app = new Frog({ - hub: hubs.frog(), + hub: neynar({ apiKey: 'NEYNAR_FROG_FM' }), ui: { vars }, verify: 'silent', }) diff --git a/site/pages/platforms/bun.mdx b/site/pages/platforms/bun.mdx index 402354c5..fa34e11f 100644 --- a/site/pages/platforms/bun.mdx +++ b/site/pages/platforms/bun.mdx @@ -75,11 +75,11 @@ app.frame('/', (c) => { }) ``` -:::warning -Feel free to use our public Hub API URL for [frame verification](https://docs.farcaster.xyz/reference/frames/spec#securing-frames:~:text=Unsigned%20messages%20can%20be%20spoofed%20and%20should%20usually%20be%20ignored.%20It%20is%20only%20safe%20to%20use%20them%20if%20you%20are%20performing%20an%20unauthenticated%20request.): `https://api.hub.wevm.dev`. +:::tip +Feel free to use the `neynar` hub aling with our Neynar API Key: `"NEYNAR_FROG_FM"`. -However, please note that this URL is not guaranteed to be stable. -It is recommended to use your own Hub API URL in production. +However, please note that this API Key is for development purposes only – it is prone to rate-limiting. +It is recommended to use your own API Key in production. [See more](https://neynar.com/#get-started). ::: ### Add Bun Server diff --git a/site/pages/platforms/cloudflare-workers.mdx b/site/pages/platforms/cloudflare-workers.mdx index 8b3b77fb..afa04b64 100644 --- a/site/pages/platforms/cloudflare-workers.mdx +++ b/site/pages/platforms/cloudflare-workers.mdx @@ -69,11 +69,11 @@ app.frame('/', (c) => { }) ``` -:::warning -Feel free to use our public Hub API URL for [frame verification](https://docs.farcaster.xyz/reference/frames/spec#securing-frames:~:text=Unsigned%20messages%20can%20be%20spoofed%20and%20should%20usually%20be%20ignored.%20It%20is%20only%20safe%20to%20use%20them%20if%20you%20are%20performing%20an%20unauthenticated%20request.): `https://api.hub.wevm.dev`. +:::tip +Feel free to use the `neynar` hub aling with our Neynar API Key: `"NEYNAR_FROG_FM"`. -However, please note that this URL is not guaranteed to be stable. -It is recommended to use your own Hub API URL in production. +However, please note that this API Key is for development purposes only – it is prone to rate-limiting. +It is recommended to use your own API Key in production. [See more](https://neynar.com/#get-started). ::: ### Export Default diff --git a/site/pages/platforms/next.mdx b/site/pages/platforms/next.mdx index ba46520b..26dd51c7 100644 --- a/site/pages/platforms/next.mdx +++ b/site/pages/platforms/next.mdx @@ -71,11 +71,11 @@ app.frame('/', (c) => { }) ``` -:::warning -Feel free to use our public Hub API URL for [frame verification](https://docs.farcaster.xyz/reference/frames/spec#securing-frames:~:text=Unsigned%20messages%20can%20be%20spoofed%20and%20should%20usually%20be%20ignored.%20It%20is%20only%20safe%20to%20use%20them%20if%20you%20are%20performing%20an%20unauthenticated%20request.): `https://api.hub.wevm.dev`. +:::tip +Feel free to use the `neynar` hub aling with our Neynar API Key: `"NEYNAR_FROG_FM"`. -However, please note that this URL is not guaranteed to be stable. -It is recommended to use your own Hub API URL in production. +However, please note that this API Key is for development purposes only – it is prone to rate-limiting. +It is recommended to use your own API Key in production. [See more](https://neynar.com/#get-started). ::: ### Add Handlers diff --git a/site/pages/platforms/node.mdx b/site/pages/platforms/node.mdx index 0a55f0b1..817341b0 100644 --- a/site/pages/platforms/node.mdx +++ b/site/pages/platforms/node.mdx @@ -61,11 +61,11 @@ app.frame('/', (c) => { }) ``` -:::warning -Feel free to use our public Hub API URL for [frame verification](https://docs.farcaster.xyz/reference/frames/spec#securing-frames:~:text=Unsigned%20messages%20can%20be%20spoofed%20and%20should%20usually%20be%20ignored.%20It%20is%20only%20safe%20to%20use%20them%20if%20you%20are%20performing%20an%20unauthenticated%20request.): `https://api.hub.wevm.dev`. +:::tip +Feel free to use the `neynar` hub aling with our Neynar API Key: `"NEYNAR_FROG_FM"`. -However, please note that this URL is not guaranteed to be stable. -It is recommended to use your own Hub API URL in production. +However, please note that this API Key is for development purposes only – it is prone to rate-limiting. +It is recommended to use your own API Key in production. [See more](https://neynar.com/#get-started). ::: ### Add Node Server diff --git a/site/pages/platforms/vercel.mdx b/site/pages/platforms/vercel.mdx index e0efb441..2922296f 100644 --- a/site/pages/platforms/vercel.mdx +++ b/site/pages/platforms/vercel.mdx @@ -74,11 +74,11 @@ app.frame('/', (c) => { }) ``` -:::warning -Feel free to use our public Hub API URL for [frame verification](https://docs.farcaster.xyz/reference/frames/spec#securing-frames:~:text=Unsigned%20messages%20can%20be%20spoofed%20and%20should%20usually%20be%20ignored.%20It%20is%20only%20safe%20to%20use%20them%20if%20you%20are%20performing%20an%20unauthenticated%20request.): `https://api.hub.wevm.dev`. +:::tip +Feel free to use the `neynar` hub aling with our Neynar API Key: `"NEYNAR_FROG_FM"`. -However, please note that this URL is not guaranteed to be stable. -It is recommended to use your own Hub API URL in production. +However, please note that this API Key is for development purposes only – it is prone to rate-limiting. +It is recommended to use your own API Key in production. [See more](https://neynar.com/#get-started). ::: ### Add Vercel Handlers diff --git a/src/hubs/frog.ts b/src/hubs/frog.ts deleted file mode 100644 index 6611f857..00000000 --- a/src/hubs/frog.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { createHub } from './utils.js' - -export const frog = createHub(() => { - return { - apiUrl: 'https://api.hub.wevm.dev', - } -}) diff --git a/src/hubs/index.ts b/src/hubs/index.ts index 5768ed02..25919ece 100644 --- a/src/hubs/index.ts +++ b/src/hubs/index.ts @@ -1,3 +1,2 @@ -export { frog } from './frog.js' export { neynar } from './neynar.js' export { pinata } from './pinata.js' diff --git a/src/utils/verifyFrame.test.ts b/src/utils/verifyFrame.test.ts index 7e7e3cc6..d99d43e0 100644 --- a/src/utils/verifyFrame.test.ts +++ b/src/utils/verifyFrame.test.ts @@ -1,5 +1,4 @@ import { expect, test } from 'vitest' -import { frog } from '../hubs/frog.js' import { neynar } from '../hubs/neynar.js' import { verifyFrame } from './verifyFrame.js' @@ -8,7 +7,7 @@ test('valid', async () => { '0a4f080d10ff2f18c1a6802f20018201400a2168747470733a2f2f746573742d66617263362e76657263656c2e6170702f61706910011a1908ff2f1214000000000000000000000000000000000000000112141de03010b0ce4f39ba4b8ff29851d0d610dc5ddd180122404aab47af096150fe7193713722bcdd6ddcd6cd35c1e84cc42e7713624916a97568fa8232e2ffd70ce5eeafb0391c7bbcdf6c5ba15a9a02834102b016058e7d0128013220daa3f0a5335900f542a266e4b837309aeac52d736f4cf9b2eff0d4c4f4c7e58f' await verifyFrame({ frameUrl: 'https://test-farc6.vercel.app/api/foo', - hub: frog(), + hub: neynar({ apiKey: 'NEYNAR_FROG_FM' }), trustedData: { messageBytes }, url: 'https://test-farc6.vercel.app/api', }) @@ -20,12 +19,12 @@ test('invalid hash', async () => { await expect(() => verifyFrame({ frameUrl: 'https://test-farc6.vercel.app/api', - hub: frog(), + hub: neynar({ apiKey: 'NEYNAR_FROG_FM' }), trustedData: { messageBytes }, url: 'https://test-farc6.vercel.app/api', }), ).rejects.toMatchInlineSnapshot( - '[Error: message is invalid. invalid hash. Expected=29,224,48,16,176,206,79,57,186,75,143,242,152,81,208,214,16,220,93,221, computed=8,220,37,101,87,167,118,64,111,118,46,240,175,199,186,11,191,124,144,0]', + '[Error: message is invalid. No data in message.]', ) }) @@ -35,7 +34,7 @@ test('invalid url', async () => { await expect(() => verifyFrame({ frameUrl: 'https://test-farc7.vercel.app/api', - hub: frog(), + hub: neynar({ apiKey: 'NEYNAR_FROG_FM' }), trustedData: { messageBytes }, url: 'https://test-farc6.vercel.app/foo', }),