How to access Netlify Continuous Deployment Pre-Defined Env. Variables in client side JS?

I am new to Netlify and I am having some trouble figuring out how to access one of the pre-defined variables from continuous deployment client-side.

I am using for error tracking and want to tag all the errors to a release (the COMMIT_REF variable), how would I go about being able to access this COMMIT_REF variable with client-side JS, or is this even possible? I currently do not have any build commands, it is simply HTML and JS files.

From the research I have done, I would need to use a site builder but I do not have any idea on where to start with this.

Any help would be appreciated. Sorry for the trouble. :slight_smile:

Hi there,

You would have to interpolate that at build time, which is the only time that Netlify both knows the commit ref, and can change your files. I understand you don’t have a build command now but you’d need to create one to “do something” with the environment variable, so check out this article about how environment variables at netlify work and how to use them: