I’m wondering if anybody has a great solution for setting the NEXTAUTH_URL env var dynamically for PR builds. Right now we’re going in and manually copying and pasting the PR URL in as the NEXTAUTH_URL env for the PR env. Is there a way to use RENDER_EXTERNAL_HOSTNAME automatically so we don’t have to do that?
you can achieve this via your start command,
NEXTAUTH_URL=$RENDER_EXTERNAL_HOSTNAME yarn start. I actually added this approach to our docs for React but the same applies for Next - see this at https://render.com/docs/deploy-create-react-app#environment-variables
I hope that helps,
Oh sweet! Thanks for pointing that out. I’m gonna try it now