Using Environment Variables With SvelteKit

Поділитися
Вставка
  • Опубліковано 19 січ 2025

КОМЕНТАРІ • 26

  • @TelefonSquid
    @TelefonSquid Рік тому +5

    underrated channel. has been enormously very helpful for me to get started in sveltekit

  • @mr_clean575
    @mr_clean575 7 місяців тому +1

    How would you add environment variables like these that are able to be accessed by files in the root (for example, a Drizzle config file)?

  • @danielbordeleau
    @danielbordeleau 3 місяці тому

    great explanation! Thanks

  • @JLO-qy5to
    @JLO-qy5to 2 роки тому

    Thank you very much. Helps me to understand the topic clearly. I came to this video via the blog post

  • @datashat
    @datashat Рік тому

    Thanks for this. The SvelteKit docs are lacking in this area!

  • @markobogosavljevic3336
    @markobogosavljevic3336 2 роки тому +1

    Another amazing video. Keep it up!

  • @rahulxcr
    @rahulxcr Рік тому

    Thanks this is very helpful.

  • @guilhermecosta6731
    @guilhermecosta6731 2 роки тому +1

    Hi, your work is excelent! What is this zsh plugin that shows the current node version and the :fire: in the terminal? I've loved it!

    • @JoyofCodeDev
      @JoyofCodeDev  2 роки тому +1

      You can find what I use in the description! 😄 I'm using the starship.rs/ prompt which can be customized however you want.

  • @vrx_ui
    @vrx_ui Рік тому

    how can I add environment values that vercel provides an option for?

    • @JoyofCodeDev
      @JoyofCodeDev  Рік тому +1

      You have to set the environment variables inside the Vercel dashboard.

    • @vrx_ui
      @vrx_ui Рік тому

      @@JoyofCodeDev while deploying i did, but it’s not detecting the value. I used ‘process.env.VITE_VALUE_NAME’ i have just value name set as env while deploying. And added VITE_ later. Or do i have to do something else, because i checked, that i have to write, ‘import.meta.process.env.VITE_…’ in the code…is that right?

  • @dei8bit
    @dei8bit 5 місяців тому

    bro i have a question:
    i have mi SECRET_apiKey = blablabla in my '.env' file in root directory
    and i have the next code in my '+page.server.js' :
    import {SECRET_apiKey} from '$env/static/private'
    export const load = () => {
    return { apiKey: SECRET_apiKey }
    }
    so in my file ''+page.svelte' i have the next code:
    export let data
    const apiKey = data._apiKey
    and i use this for make a call to an API.
    BUT!!
    when i see the developer tools in network tabs , while i trigger this api call i can see my secret api key in the request url of the headers and also the payload...
    so this is because i'm in develop mode?
    or maybe because I have the function that makes the call to the api in the file '+page.svelte'?
    I read the documentation and watched a lot of videos but I can't find the answer.

  • @ZadockCarter
    @ZadockCarter 2 роки тому

    Thank you!

  • @AlexanderDemin
    @AlexanderDemin Рік тому

    Can you make a video of dockerizing sveltekit app?

    • @JoyofCodeDev
      @JoyofCodeDev  Рік тому +3

      I only used Docker a couple of times but I could make a video on how to deploy a containerized app.

  • @saniee_dev
    @saniee_dev 2 роки тому

    Eyyy, you did it

  • @bobbyLovesTech
    @bobbyLovesTech Рік тому

    Thank you!