Ferdinand
Oct 16, 2023

--

Hi, use process.env for secret keys.

Delete VITE_ from your secret variables and in your vite.config.ts or js add this :

```

import { defineConfig, loadEnv } from 'vite'

const env = loadEnv(' ', process.cwd(), ' ');

// https://vitejs.dev/config/

export default defineConfig({

...

define: {

'process.env': env,

},

}

```

Use your secret in your code with process.env.SECRET_NAME

--

--

Ferdinand
Ferdinand

Written by Ferdinand

Tezos/Etherlink lover. @chainlink expert dev ( volunteering ). You should take a look at @Subsprotocol.

Responses (1)