Next.js Discord

Discord Forum

Someone knows how to deploy in GitHub using instagram API ??

Unanswered
Schipperke posted this in #help-forum
Open in Discord
SchipperkeOP
My site its not showing the instagram pictures from the API.

21 Replies

Sun bear
I think you have to add more context. Title is very confusing and regarding not showing and api maybe you can provide Code
@Sun bear I think you have to add more context. Title is very confusing and regarding not showing and api maybe you can provide Code
SchipperkeOP
Im using the instagram API to put the pictures in the site, its working in my pc but when i deploy its doesnt work online
@Schipperke Im using the instagram API to put the pictures in the site, its working in my pc but when i deploy its doesnt work online
Sun bear
I think you are making any kind of request to instagram api. Maybe via fetch(...

Ich would console log the response then you should see whats the problem. maybe a 403 and then you have to double check the api key
But to get a better answer please share some code or provide more details to "its not working"
@Sun bear I think you are making any kind of request to instagram api. Maybe via fetch(... Ich would console log the response then you should see whats the problem. maybe a 403 and then you have to double check the api key
SchipperkeOP
my code and the problem
@Schipperke Can add you here on discord ?
Sun bear
See here. Your token is undefined.

Most likely you forgot to add the env variable in production.

By the way you should not use next_public for that. Mark the file with fetchInstragramData as use server and put the token in the funcrion and npt above
@Schipperke I put in the env, this is happening in the deploy only
Sun bear
Where do you deploy?
Vercel?
@Sun bear Where do you deploy?
SchipperkeOP
On github
I could send the link but is portuguese
Sun bear
Didnt know github is able to host node applications.

In general you dont use an .emv file in production. There are interface in your hosting where you set env up
@Sun bear Didnt know github is able to host node applications. In general you dont use an .emv file in production. There are interface in your hosting where you set env up
SchipperkeOP
On github there is a parte where i put the tokens, it should taken from there but i dont know why isnt working
Maybe i should deploy in vercel hehe :thinq:
Sun bear
Either use vercel or recheck how to setup env in github. But atleast thats why its not working
SchipperkeOP
In searching everything about this on github but there isnt much things to see
@Sun bear Either use vercel or recheck how to setup env in github. But atleast thats why its not working
SchipperkeOP
If doesnt work in vercel, can i send u a msg again ? 😦
GitHub does not host node. It can host static assets generated by node (html/js) as part of their GitHub pages offering.

This means that any env variable you add that is referenced will be insecure and sent to the browser. Anyone will be able to read it by examining the bundle.
SchipperkeOP
Thanks guys, with vercel is working now 🙂