So for nx cloud we get …

less than 1 minute read

So for nx-cloud, we get a read-only token and a read-write for ci. I see the spot for the token in nx.json but I’m not sure which token should go there. Does nx look for the env var and use that value and if not uses the value in nx.json? How does this work?

Responses:

ill take a look for you

looks in env first then nx.json

function createApi(errors, options) { const baseUrl = options.url || '<https://api.nrwl.io>'; if (process.env.NX_CLOUD_AUTH_TOKEN) { return new CloudApi(errors, baseUrl, process.env.NX_CLOUD_AUTH_TOKEN); } else { return new CloudApi(errors, baseUrl, options.accessToken); } }

ah ok. so I don’t really need a token in the nx.json as long as I have the env vars setup then

yup! That is how we have it setup right now. i have my token in my bash profile

awesome! Thanks Jay!

Updated: