<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ivana Croxcatto</title>
    <description>The latest articles on DEV Community by Ivana Croxcatto (@ivana_croxcatto).</description>
    <link>https://dev.to/ivana_croxcatto</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F129084%2F6c26706d-e63f-4c8e-b0ad-f4e5dccf9b2e.gif</url>
      <title>DEV Community: Ivana Croxcatto</title>
      <link>https://dev.to/ivana_croxcatto</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ivana_croxcatto"/>
    <language>en</language>
    <item>
      <title>Paso a paso para empezar con GitHub y publicar páginas en Vercel</title>
      <dc:creator>Ivana Croxcatto</dc:creator>
      <pubDate>Fri, 04 Sep 2020 02:12:54 +0000</pubDate>
      <link>https://dev.to/ivana_croxcatto/paso-a-paso-para-empezar-con-github-y-publicar-paginas-en-vercel-gim</link>
      <guid>https://dev.to/ivana_croxcatto/paso-a-paso-para-empezar-con-github-y-publicar-paginas-en-vercel-gim</guid>
      <description>&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; Abrimos una cuenta en &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;GitHub&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; En GitHub, vamos al ícono de nuestro perfil y abrimos la configuración: &lt;a href="https://github.com/settings/profile" rel="noopener noreferrer"&gt;https://github.com/settings/profile&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; Hacemos clic en &lt;strong&gt;SSH and GPG keys&lt;/strong&gt;: &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fp1ny2gaehmxldapbv5xb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fp1ny2gaehmxldapbv5xb.png" alt="SSH and GPG keys step"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; Dejamos eso por un momento y descargamos &lt;strong&gt;Git&lt;/strong&gt; desde &lt;a href="https://git-scm.com/downloads" rel="noopener noreferrer"&gt;acá&lt;/a&gt;. Eso nos va a permitir tener la consola de Git en nuestro equipo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.&lt;/strong&gt; &lt;a href="https://www.stanleyulili.com/git/how-to-install-git-bash-on-windows/" rel="noopener noreferrer"&gt;Acá&lt;/a&gt; buen recurso para leer sobre la instalación de Git.&lt;br&gt;
También podemos hacer clic en &lt;strong&gt;Next&lt;/strong&gt; en todas las ventanas y usar la instalación predeterminada. Lo importante en este caso es que esté seleccionado &lt;strong&gt;Git Bash&lt;/strong&gt; en los componentes que queremos que se instalen:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fkrau2d7gwd5v0t136nxo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fkrau2d7gwd5v0t136nxo.png" alt="Git Bash - instalación"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6.&lt;/strong&gt; Ahora, nos paramos sobre cualquier carpeta del explorador de carpetas de Windows y hacemos clic con el botón derecho, para que se abra el menú contextual:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Flsiq03slfyr1nzki1qwy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Flsiq03slfyr1nzki1qwy.png" alt="Git Bash en menú contextual"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7.&lt;/strong&gt; Elegimos &lt;em&gt;Git Bash Here&lt;/em&gt; para que se abra la consola. Ahí buscamos si ya tenemos creada una llave SSH. Para eso, escribimos un comando al lado del símbolo $ que aparece en la consola. Ponemos ls -al ~/.ssh y vemos si aparece algún resultado tal como los siguientes:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fsbizwxp2ej49fpvrdhe0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fsbizwxp2ej49fpvrdhe0.png" alt="Claves SSH"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8.&lt;/strong&gt; Si no tenemos ninguna de esas, tenemos que creearla. Para eso, en la misma consola, escribimos este comando: &lt;strong&gt;ssh-keygen -t rsa -b 4096 -C “&lt;a href="mailto:tu_direccion_de_correo@gmail.com"&gt;tu_direccion_de_correo@gmail.com&lt;/a&gt;”&lt;/strong&gt; (lo que va entre comillas es la dirección que hayan usado para crear su cuenta de GitHub en el punto 1 de esta guía.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9.&lt;/strong&gt; Esperamos que se ejecute todo el proceso y, cuando aparezca la pregunta  &lt;strong&gt;"Enter a file in which to save the key"&lt;/strong&gt; presionamos &lt;em&gt;Enter&lt;/em&gt; en el teclado para que se guarde en el lugar predeterminado. Cuando aparece &lt;strong&gt;PASSPHRASE&lt;/strong&gt; o &lt;strong&gt;NAME&lt;/strong&gt;, solo presionamos &lt;em&gt;Enter&lt;/em&gt; para no tener que recordar después una clave asociada. O sea, ejecutamos todo el proceso predeterminado hasta que finaliza.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10.&lt;/strong&gt; Va a aparecer un bloque largo de texto en la consola que empieza con &lt;strong&gt;ssh-rsa&lt;/strong&gt; y termina con la dirección de correo electrónico que le hayan pasado. Esa es nuestra &lt;strong&gt;clave SSH&lt;/strong&gt; que vamos a usar para GitHub.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11.&lt;/strong&gt; Volvemos a &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; a la página que habíamos dejado abierta: &lt;a href="https://github.com/settings/keys" rel="noopener noreferrer"&gt;https://github.com/settings/keys&lt;/a&gt; (pasos 1, 2 y 3 de esta guía).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;12.&lt;/strong&gt; Hacemos clic en:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fy4u7p8guf8yi3czyywnr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fy4u7p8guf8yi3czyywnr.png" alt="nueva clave SSH"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;13.&lt;/strong&gt; Ahí pegamos el contenido de nuestra llave SSH (el texto largo que está en nuestra consola). &lt;a href="https://medium.com/@ancizj393/crear-una-clave-ssh-en-git-y-vincular-en-tu-cuenta-de-github-e7a6b22bc93f" rel="noopener noreferrer"&gt;Este es un buen artículo&lt;/a&gt; para leer sobre este tema por si tienen dudas en algún paso. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;14.&lt;/strong&gt; Una vez vinculado el equipo con GitHub, podemos crear repositorios en GitHub y subir archivos. Para crear un repositorio: hacemos clic en el ícono de GitHub en la esquina superior izquierda de la página:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqocikdpzvhry5y5uvfx0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqocikdpzvhry5y5uvfx0.png" alt="ícono de GitHub"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;15.&lt;/strong&gt; Hacemos clic en &lt;strong&gt;New&lt;/strong&gt; y creamos un repositorio nuevo:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwo0exttvbqbpa55nnjm3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwo0exttvbqbpa55nnjm3.png" alt="repositorio nuevo"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7ayfxl6ez8weni943zzx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7ayfxl6ez8weni943zzx.png" alt="nombre del repositorio nuevo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;16.&lt;/strong&gt; Bajamos por esa página y hacemos clic en:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpkdwc9w0zgn19gbpq0lm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpkdwc9w0zgn19gbpq0lm.png" alt="crear repositorio"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;17.&lt;/strong&gt; Dejamos eso unos minutos y vamos a nuestra carpeta donde tenemos los archivos de nuestro sitio web, página o lo que queramos subir a GitHub. Abrimos esa carpeta, hacemos clic con el botón derecho y elegimos &lt;strong&gt;Git Bash Here&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhfgc48b4r92su84xn3qt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhfgc48b4r92su84xn3qt.png" alt="menú contextual con Git Bash Here"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;18.&lt;/strong&gt; Se abre la consola de &lt;strong&gt;Git Bash&lt;/strong&gt;. Prestemos atención a que la ruta que nos muestra sea exactamente donde están los archivos que nos interesan: En este caso, muestra toda la ruta y termina en &lt;strong&gt;…/clase7&lt;/strong&gt; que es donde están los archivos index y styles que se ven en la imagen. En la consola, junto al símbolo &lt;strong&gt;$&lt;/strong&gt;, escribimos &lt;strong&gt;git init&lt;/strong&gt;. Ese es el comando de Git que vamos a escribir cada vez que iniciemos un repositorio. Apretamos &lt;em&gt;Enter&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;19.&lt;/strong&gt; Dejamos que se ejecute el proceso y, cuando aparece otra vez el signo &lt;strong&gt;$&lt;/strong&gt; contra el margen izquierdo, escribimos &lt;strong&gt;git add .&lt;/strong&gt; (así, tal cual git espacio add espacio punto). Ese comando agrega los archivos a la memoria del repositorio.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;20.&lt;/strong&gt; Junto al signo &lt;strong&gt;$&lt;/strong&gt;, escribimos &lt;strong&gt;git commit -m “mensaje”&lt;/strong&gt; (así, tal cual, git espacio commit espacio guion del medio y m, sin espacio entre el guion y la m espacio comillas mensaje comillas). El mensaje entre comillas es nuestro, podemos poner lo que se nos ocurra. Eso agrega un mensaje a nuestro repositorio y es obligatorio agregarlo. &lt;em&gt;Enter&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;21.&lt;/strong&gt; Volvemos a nuestra cuenta de GitHub, después de haber creado el repositorio. Aparece una página con un montón de sugerencias, nos interesa esto:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fs70lhrr8jvlm6ddp8vbc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fs70lhrr8jvlm6ddp8vbc.png" alt="comandos para subir archivos a Git"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;22.&lt;/strong&gt; Copiamos toda la primera línea,, que dice &lt;strong&gt;git remote add origin...&lt;/strong&gt; y la pegamos en nuestra consola junto al símbolo &lt;strong&gt;$&lt;/strong&gt;. No funciona el atajo C+V en la consola, así que hay que usar botón derecho y &lt;em&gt;Paste&lt;/em&gt; (Pegar). &lt;em&gt;Enter&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;23.&lt;/strong&gt; Cuando termina el proceso, copiamos la tercera línea (&lt;strong&gt;git push –u origin master&lt;/strong&gt;) y la pegamos en nuestra consola. No funciona el atajo C+V en la consola, así que hay que usar botón derecho y &lt;em&gt;Paste&lt;/em&gt; (Pegar). &lt;em&gt;Enter&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;24.&lt;/strong&gt; Esto sube nuestro código desde nuestra PC a nuestro repositorio de GitHub. Si vamos a &lt;strong&gt;Code&lt;/strong&gt; en la página de GitHub, vamos a ver nuestro código subido ahí:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ff9hc0wxxjpi7vop0zb2b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ff9hc0wxxjpi7vop0zb2b.png" alt="código en GitHub"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;25.&lt;/strong&gt; Ahora, vamos a &lt;a href="https://vercel.com/import/git" rel="noopener noreferrer"&gt;Vercel&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;26.&lt;/strong&gt; Si no tenemos cuenta en Vercel, creamos una.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;27.&lt;/strong&gt; Aparece un cuadro donde agregar la URL de nuestro código de GitHub:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd1ia5knnxzk2anqqxcc1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd1ia5knnxzk2anqqxcc1.png" alt="conectar GitHub con Vercel"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;28.&lt;/strong&gt; Ahí pegamos la URL del repositorio que creamos en GitHub, en este caso &lt;strong&gt;&lt;a href="https://github.com/*tu_usuario*/prueba" rel="noopener noreferrer"&gt;https://github.com/*tu_usuario*/prueba&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;29.&lt;/strong&gt; Presionamos &lt;strong&gt;Continue&lt;/strong&gt;, en la siguiente ventana, también &lt;strong&gt;Continue&lt;/strong&gt; y en la tercera ventana, presionamos &lt;strong&gt;Deploy&lt;/strong&gt;. Después de unos momentos, aparece:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Frufkn2rvuk5ws8uxc42v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Frufkn2rvuk5ws8uxc42v.png" alt="repositorio conectado con Vercel"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;30.&lt;/strong&gt; Hacemos clic en &lt;strong&gt;Visit&lt;/strong&gt; y podremos ver nuestro proyecto en línea y lo podremos compartir con quien queramos para que también lo vea.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;31.&lt;/strong&gt; Cada vez que modifiquemos, borremos o agreguemos archivos que tenemos en nuestra PC, tenemos que subirlos de nuevo a GitHub. Pero ahora, solo tenemos que repetir los &lt;strong&gt;pasos 19 y 20&lt;/strong&gt; de esta guía para que se guarden los cambios en nuestra memoria de git local. Una vez hecho eso, escribimos &lt;strong&gt;git push&lt;/strong&gt; en la consola, junto al signo &lt;strong&gt;$&lt;/strong&gt; y automáticamente (si tenemos Internet), nuestras modificaciones se suben a nuestro repositorio en GitHub y se actualizan en Vercel.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;32.&lt;/strong&gt; Cuando creemos un repositorio nuevo en GitHub (porque es otro proyecto), tenemos que hacer todo el proceso desde el paso 17 en adelante. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Espero que te sirva esta guía y, si tenés alguna corrección o comentario, escribime. ¡Gracias!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Fuentes consultadas: &lt;a href="https://www.stanleyulili.com/git/how-to-install-git-bash-on-windows/" rel="noopener noreferrer"&gt;https://www.stanleyulili.com/git/how-to-install-git-bash-on-windows/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://medium.com/@ancizj393/crear-una-clave-ssh-en-git-y-vincular-en-tu-cuenta-de-github-e7a6b22bc93f" rel="noopener noreferrer"&gt;https://medium.com/@ancizj393/crear-una-clave-ssh-en-git-y-vincular-en-tu-cuenta-de-github-e7a6b22bc93f&lt;/a&gt;&lt;/p&gt;

</description>
      <category>github</category>
      <category>vercel</category>
      <category>ssh</category>
      <category>website</category>
    </item>
    <item>
      <title>Hiding API Keys in Your Code</title>
      <dc:creator>Ivana Croxcatto</dc:creator>
      <pubDate>Sat, 13 Jun 2020 23:02:59 +0000</pubDate>
      <link>https://dev.to/ivana_croxcatto/hiding-api-keys-in-your-code-1h0a</link>
      <guid>https://dev.to/ivana_croxcatto/hiding-api-keys-in-your-code-1h0a</guid>
      <description>&lt;p&gt;Let's say you are using a fetch in React App to get info from an API, and are using your API key to connect to that API. The key is private, and should not be visible outside your code. How can you achieve that and keep your code functional?&lt;br&gt;
These are my notes on what worked for me. It took me a while to figure it out, so I wanted to share it, as a personal note to self, and, hopefully, to help someone else with the same issue.&lt;/p&gt;

&lt;h2&gt;
  
  
  These are the steps I followed:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1-&lt;/strong&gt; Write &lt;strong&gt;npm install dotenv&lt;/strong&gt; in the Terminal (I am using the Terminal in VSC).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2-&lt;/strong&gt;Create an &lt;strong&gt;.env&lt;/strong&gt; file in the root folder of the project (this means, outside the &lt;strong&gt;src&lt;/strong&gt; folder).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3-&lt;/strong&gt;This .env file will have the environment variables that are to be kept hidden. Since I am using React App, these variables have to be preceded by &lt;strong&gt;REACT_APP_&lt;/strong&gt;. In my case, my variable is called &lt;strong&gt;REACT_APP_API_KEY=numberOfYourAPIKey&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4-&lt;/strong&gt;Go to the .gitignore file in the root folder, and make sure &lt;strong&gt;.env&lt;/strong&gt; is added to the list of files that will not make it into GitHub.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5-&lt;/strong&gt;Go to your App.js file, and on the top list of "imports," (before declaring the App function), declare a variable to call the config function. I wrote &lt;strong&gt;const dotenv = require('dotenv').config()&lt;/strong&gt; (you can use the variable name of your choice).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6-&lt;/strong&gt;Go to any component using this API key, and, inside that component js file, declare a variable that will contain the API Key from your .env file. I wrote &lt;strong&gt;const api_key = process.env.REACT_APP_API_KEY&lt;/strong&gt;. This is the variable you will use in your fetch. For example, fetch(&lt;code&gt;https://api.example.org/data/api_key=${api_key}&lt;/code&gt;)&lt;br&gt;
The first "api_key" in the example is given by the API URL, the one inside the curly brackets is the name of my variable "api_key".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7-&lt;/strong&gt;You can upload your project to GitHub now, and your API Key will not be visible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8-&lt;/strong&gt;In my case, I deployed my project to zeit.co (now vercel.com), by importing my GitHub project into this platform. Once imported, you will see three tabs in vercel.com: Overview, Deployment, Settings. Inside &lt;strong&gt;Settings&lt;/strong&gt;, you will find the option to declare a variable under &lt;strong&gt;Environment Variables&lt;/strong&gt;. There you should use the name of the variable you used in your .env file (REACT_APP_API_KEY), and copy-paste the actual value of the variable (your API Key) in the field box next to the variable name, where it says "VALUE (WILL BE ENCRYPTED)". &lt;/p&gt;

&lt;p&gt;Your code should be working as if the actual API Key was still shown in your code, only now it will be hidden outside your local environment. Hope it helps! &lt;/p&gt;

</description>
      <category>react</category>
      <category>github</category>
      <category>environmentvariables</category>
      <category>zeit</category>
    </item>
  </channel>
</rss>
