Testing Twitter Cards #16499
Unanswered
jensmeindertsma
asked this question in
Help
Replies: 1 comment 3 replies
-
In your next.config.js: module.exports = {
env: {
baseUrl: process.env.BASE_URL || process.env.VERCEL_URL,
}
} Then in your code Then add a production environment variable API_URL. But don't create one for the preview environment. Then it will fall back on VERCEL_URL. You can create an environment variable in the preview environment and it will automatically get set by the platform (https://vercel.com/docs/build-step#environment-variables) (If you're not using Vercel, then you'll have to look at your platforms environment for the equivalent) |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Twitter Cards require that you provide an absolute URL for the card image. A Twitter Cards metadata tag looks like this:
I would like to replace
https://myproductionurl.com
by the actual deployment URL at build time. Currently I just use the production URL here, but this means the cards don't work properly on staging deployments ( i.e. when I change the card image on staging deployments ).Is there an exposed environment variable I can use for this?
Beta Was this translation helpful? Give feedback.
All reactions