DEV Community

Discussion on: Create a real time web app with Hasura and Gatsby

Collapse
 
rparticledd profile image
Rahul Sharma

Where does the token actually come from in the gatsby config. I am getting an error
ReferenceError: token is not defined

Please help.

Collapse
 
lightstrike profile image
lightstrike

It's a placeholder, you can either paste in a string or (my recommendation), put it in an .env file and reference like bearer ${process.env.HASURA_TOKEN}, where your .env file has a row like HASURA_TOKEN='token-string'. Gatsby docs about environment variables here: gatsbyjs.org/docs/environment-vari...