Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

211
Visualizações
How to obtain api key from user in a node.js CLI?

I'm creating a CLI with Node.js that needs to take in information from MediaWiki's API (Wikipedia's platform) and from Steam's API. The first part isn't too much of an issue since it doesn't require anything, but Steam's needs an API key. This is fine when I'm testing it myself, since I can just put mine in, but that's neither safe nor efficient if used by others.

What would be the best way to acquire and store a user's API key? I was attempting to read up on OAuth but I have no clue how you'd do that in a local CLI app. I also saw something about just asking the user to get an API key, but that seems inconvenient (and I'm not sure how I'd store that on their computer safely anyway). Is there a better option?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Just use a .env local file and add it to your .gitignore file, put the API_KEY as a variable and only you can read the content in your local 'cause you're not pushing this file to your remote repo. If you have issues using .env files just install dotenv npm package, it's very useful: https://www.npmjs.com/package/dotenv

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda