DEV Community

Discussion on: How To Build A Nuxt 3 Ionic Capacitor Starter App, Supabase Setup and Authentication

Collapse
 
craxtrader profile image
Crax Trader • Edited

any advice.... How to protect API Key for SSR mode

Collapse
 
muadzmr profile image
Mu'adz Mohd Rosli

This is maybe late but I think you can use nuxt.config.ts file to specify the API key. Like this:

export default defineNuxtConfig({
  ...
  runtimeConfig: {
    apiKey: process.env.API_KEY,

    public: {
      // do not put it here
    }
  },
  ...
});
Enter fullscreen mode Exit fullscreen mode

Hope this help.