Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

208
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda