Using Doppler with a monorepo in netlify

I’m trying to use doppler in my production environment in netlify on which I am deploying a monorepo with a frontend and multiple functions (three of them) which are in the folders


But the doppler environment variables are showing up in the frontend web-react-ts. but in the functions folder, the functions don’t seem to have access to the env variables. What could be the reason.

This is the build command I’m running

npm run doppler-install && npm i && cd api && npm i && cd ../web-react-ts && npm i && cd .. && ./doppler setup --no-interactive --token $DOPPLER_TOKEN_PRD && ./doppler run --token $DOPPLER_TOKEN_PRD --command='npm run build && cp api/src/resolvers/texts.json api/build/resolvers/. && cp -r api/build/schema api/build/functions/graphql/. && cd api/src/functions/graphql && npm I'

Hi @jaedag!

We’ve been discussing this already in the support ticket you opened, but I’ll reply here as well in case it helps anyone else!

The best option here is to use our Netlify integration to sync secrets over to Netlify. This would avoid needing to use our CLI at all. In your case, this isn’t possible due to some of your secrets exceeding the 4kb size limit Netlify has.

To get around the 4kb limit issue, one option is to use our gitops-secrets-nodejs package. There’s a blog post that discusses using this to get around a similar limit on Vercel that should be applicable here:

If none of those work, then I’ll need some elaboration on exactly how it’s failing. Are the variables not showing up inside the npm run build task? That seems to be the only operation that’s happening inside the doppler run command outside of copying files around and performing an npm install.