title: How to access Nuxt 3 runtimeConfig in service file?
body: <p>I have service file like this .</p>
  <p><strong>service/http.ts</strong></p>
  <pre><code>import axios from 'axios'
  const config = useRuntimeConfig()
  
  const http = axios.create({
      baseURL: config.public.apiUrl,
  })
  export default http
  </code></pre>
  <p>and <strong>nuxt.config.js</strong> like this</p>
  <pre><code>export default defineNuxtConfig({
    runtimeConfig: {
      public: {
        apiUrl: 'some value',
      }
    },
  });
  </code></pre>
  <p>and <strong>.env</strong> like this</p>
  <pre><code>NUXT_API_URL=http://www.a.com/
  </code></pre>
  <p>and I want to access <strong>apiUrl</strong> here .</p>
  <p>But it gives me an <strong>error</strong>.</p>
  <p><a href="https://i.stack.imgur.com/q7SgZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q7SgZ.png" alt="enter image description here" /></a></p>
  <p>also if I use <strong>process.env.NUXT_API_URL</strong> .</p>
  <p>it gives an error again</p>
  <p>so, how can I access <strong>env</strong> variable for my services file?</p>