diff --git a/.changeset/new-moose-talk.md b/.changeset/new-moose-talk.md new file mode 100644 index 000000000..c90a06f49 --- /dev/null +++ b/.changeset/new-moose-talk.md @@ -0,0 +1,5 @@ +--- +"frames.js": patch +--- + +fix(nextjs): prioritize APP_URL over VERCEL_URL diff --git a/packages/frames.js/src/next/getCurrentUrl.ts b/packages/frames.js/src/next/getCurrentUrl.ts index e979da50e..fcf35c982 100644 --- a/packages/frames.js/src/next/getCurrentUrl.ts +++ b/packages/frames.js/src/next/getCurrentUrl.ts @@ -6,7 +6,7 @@ export function getCurrentUrl( req: Request | NextRequest | NextApiRequest | IncomingMessage ): URL | undefined { const scheme = process.env.NODE_ENV === "production" ? "https://" : "http://"; - const appUrl = process.env.VERCEL_URL || process.env.APP_URL; + const appUrl = process.env.APP_URL || process.env.VERCEL_URL; const host: string | undefined = (req.headers as any)?.host; const pathname = req.url?.startsWith("/")