1

I was working on personal projects month ago and I wanted to add a instagram feed on my site. I was building the site with Next.js,Tailwindcss, etc..

I couldn't found a good component that works how I wanted so I ventured to create one to get what I was looking for. I found some issues that I fixed but when I finished my package I still had a problem to solve. The module should be load on server side because it use a private API keys (from instagram) that sure you aren't interested the people can see it on client.

Now I throw my question: Is possible to load the component on server side using React or Next.js? I know exist "React Server Components (RFC)" but I don't know how to implement it with my component..

PD: My component get the API keys from .env file.

I let you here the links with component. https://www.npmjs.com/package/@salvagr/react-instagram-data

SalvaGR
  • 11
  • 1

1 Answers1

0

You do not need RCSs to render React components in a Next server. Next automatically enables traditional server rendering (SSR) unless you enable export.

This is also the case for app router apps, though the distinction with RSCs is that they don't get a fake DOM and only load certain things on the server.

Nick McCurdy
  • 17,658
  • 5
  • 50
  • 82