Next.js Discord

Discord Forum

Best practices for integrating an external API service (with external auth)

Unanswered
Siricid woodwasp posted this in #help-forum
Open in Discord
Siricid woodwaspOP
Hello I was wondering if you guys can help out, i just started developing in Next and i have loved it so far. But i cant find anything on what the best practices are on integrating an external API service is it by making a call layer in app/ or is it in a classical way like in plain React? I

7 Replies

there's nothing special about it, you can just do a fetch call to the external API or abstract it into something else if you want
If you’re using nextjs on the server side
You can use next auth
To encapsulate your token exchange with the external api
By build a custom provider
Oh I misread that question as an “external auth api”
🤦🏻