DEV Community

loading...

Discussion on: Getting data from Hasura onto your Nuxt.js app

Collapse
acatzk profile image
acatzk

where can i put my hasura secret key in nuxt?
before I am using vue js and this is how it works with websocket but
I'm confused how to config in nuxt with hasura

const httpLink = new HttpLink({
uri: "https://",
headers: {
'x-hasura-admin-secret': ''
}
});

const wsLink = new WebSocketLink({
uri: "wss://",
options: {
reconnect: true,
timeout: 30000,
connectionParams() {
return {
headers: {
'x-hasura-admin-secret': ''
}
}
}
}
})

Collapse
debs_obrien profile image
Debbie O'Brien Author

hey, sorry only seeing this now. the secret key should be a secret so should go in Netlify / Heroku or where you have it hosted as env variable.

Collapse
debs_obrien profile image