How to read env var from a React component

@thedavid Yes, this is what I’m doing in my component:

      <ReactFilestack
        apikey={process.env.FILESTACK_API_KEY}
        onSuccess={onFileUpload}
        componentDisplayMode={{
          type: 'button',
          customText: 'Upload Image',
          customClass: classes.submit,
        }}
        actionOptions={{
          fromSources: ['local_file_system', 'url'],
        }}
      />

I’ve added the FILESTACK_API_KEY in my .env and .env.default (just in case) files.

I noticed that RW already uses dotenv-webpack and it’s configured in the base @redwoodjs package like so:

new Dotenv({
    path: path.resolve(redwoodPaths.base, '.env'),
    silent: true,
}),

This looks correct to me, however I’m not sure if Netlify will create a .env file based on the configured ENVIRONMENT, maybe that’s the problem ?