Skip to main content

JavaScript SSR, CSR, Hybrid, and Statically Generated Sites

Reforge 🫶 JavaScript: SSR, CSR, Hybrid, and Statically Generated Sites​

Reforge is designed to work in a variety of environments, from server-side rendering (SSR) to client-side rendering (CSR) to hybrid apps that use both.

The relevant clients​

  • Node client: This runs on your server and provides in-memory evaluation of config and feature flags. You can provide it with user-specific context for those evaluations in your request handlers. It gets streaming updates over SSE from Reforge. Learn more about backend SDKs.
  • JavaScript (or React) client: This runs in the browser and makes a single HTTP request to Reforge with the current user's context to get the evaluated feature flags (and any config you've specified as "Send to frontend SDKs"). Once it has the flags, it can evaluate them in memory. Learn more about frontend SDKs.

SSR​

If you're doing pure server-side rendering, you only need the Node client.

CSR​

If you're doing pure client-side rendering, you only need the JavaScript (or React) client.

Hybrid apps​

Hybrid apps (those using SSR and CSR) will probably want both the Node and JavaScript (or React) clients.

The Node client can handle in-request evaluations, and the JavaScript (or React) client can handle client-side evaluations to determine what to render.

Improve the Performance of your Hybrid Apps

Eliminate loading states and improve performance by avoiding extra HTTP requests in your front-end by using our SSR + CSR Rehydration Guide guide for client-side rehydration.

Statically Generated Sites​

Statically generated sites can use the Node client to evaluate flags at build time. If your statically generated site has client-side rendering, you'll also want the JavaScript (or React) client.