SSR Support
This guide covers server-side rendering considerations for Next.js, Remix, and other SSR frameworks.The Challenge
The Privacy Boost SDK uses WebAssembly and browser APIs that aren’t available on the server. You need to ensure the SDK only loads on the client.Next.js
App Router
Pages Router
Dynamic Component Import
For components that use SDK hooks:Remix
Client-Only Provider
Hydration Mismatch Prevention
useIsClient Hook
Conditional Rendering
Environment Variables
Next.js
Remix
Webpack Configuration
Next.js
Testing SSR
Best Practices
- Always use ‘use client’ directive for components using SDK hooks
- Dynamic imports for large components to reduce bundle size
- Provide fallbacks for loading and server-rendered states
- Avoid window/document access without checking environment
- Use environment variables with NEXT_PUBLIC_ prefix for client access