How we can pass the build args without exposing any secrets

I am trying to create a build for nextjs but during the build it throws the error of Missing publishableKey which i already have added inside the secrets in fly.io. I dont want to pass the build args like this

[build.args]
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=KEY_VALUE

Is there any solution for this ?

Do you really need clerk auth env variables at build time? If not, flag those components as dynamic or use await connection() to prevent it from compiling buildtime.

Or you can use your CI/CD to store your secrets and inject it in your app/.env so it has access at build/run time.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.