Next.js Discord

Discord Forum

OpenGraph image becomes my vercel project name

Answered
English Angora posted this in #help-forum
Open in Discord
English AngoraOP
I have a silly issue with opengraph images.

I put down a opengraph image for og and twitter, but seems like the link in the head is wrong, it uses the vercel project name link:

https://example.vercel.app/opengraph-image.jpg

instead of

https://example.com/opengraph-image.jpg

and the image doesn't works since the route above (example.vercel.app) needs to be authed
Answered by Ray
try setting your domain in metadataBase on metadata
it will use default value VERCEL_URL if you not set it.
https://nextjs.org/docs/app/api-reference/functions/generate-metadata#metadatabase
View full answer

2 Replies