WP Render Blocks Documentation

Everything you need to deploy server-rendered React components to WordPress. From quick start to API reference.

Getting Started

Quick Start Guide

Get up and running with WP Render Blocks in minutes. This guide will walk you through creating your account, installing the WordPress plugin, and rendering your first component.

  1. Sign up for a free account at WP Render Blocks
  2. Create an organization (or join an existing one)
  3. Install the WordPress plugin from your dashboard
  4. Connect your WordPress site using the API key
  5. Upload your first React component
  6. Add the component to a page using the Gutenberg block

Installing the WordPress Plugin

The WP Render Blocks plugin connects your WordPress site to our rendering service.

Method 1: Download from Dashboard

  1. Log in to your WP Render Blocks dashboard
  2. Navigate to Dashboard → Settings → Plugin
  3. Download the latest plugin ZIP file
  4. In WordPress, go to Plugins → Add New → Upload Plugin
  5. Select the downloaded ZIP file and click Install Now
  6. Activate the plugin after installation

Method 2: Manual Installation

Extract the plugin ZIP and upload the folder to /wp-content/plugins/

API Keys & Authentication

Your WordPress site connects to WP Render Blocks using a per-site API key. The plugin stores the API key in WordPress settings and sends it in request headers (not in the URL).

  1. Create a Site in your dashboard (Dashboard → Sites)
  2. Copy the API key (Sites → select site → API Keys)
  3. In WordPress, open Settings → WP Render Blocks
  4. Paste your API URL and API key, then click Test Connection

Creating Your First Component

Components can be created using any React tooling. Here's how to prepare a component for WP Render Blocks:

Component Structure

Your component should export a default React component:

// MyComponent.jsx
import React from 'react';

export default function MyComponent({ title, description }) {
  return (
    <div className="my-component">
      <h2>{title}</h2>
      <p>{description}</p>
    </div>
  );
}

Upload ZIP requirements

  • One component per block. Do not upload full applications or multi-page sites; upload a single React component.
  • Upload a zipped component. Max upload size varies by plan.
  • Do not include node_modules/, .next/, dist/, or .git/.
  • Do not include secrets like .env / .env.local.
  • To protect the service from zip bombs and abusive uploads, we enforce limits on file count, folder depth, and unzipped size.

Uploads may be blocked if they contain unsupported files or if they require an admin security review to protect the service.

Unique package name (v0 / multiple components)

Each component is identified by the name in your package.json. Projects exported from v0 or similar tools often use the same default name for different projects, so you may see "component already exists" when uploading a second project.

  • Same component: upload a new version from that component's page (Upload new version).
  • Different component: change the name in package.json to something unique (e.g. my-component-2) and upload again.

Component Development

SSR vs CSR: Which Should I Use?

WP Render Blocks supports both server-side rendering (SSR) and client-side rendering (CSR). The right choice depends on whether the page needs SEO-friendly HTML in the page source.

  • Use SSR for public, indexable pages where SEO matters. SSR delivers crawlable HTML in your page source.
  • Use CSR for logged-in areas, dashboards, internal tools, and pages where SEO isn't required.
  • SEO note: CSR typically has lower SEO value than SSR because the initial HTML is minimal and content is generated in the browser.

SSR Compatibility

For components to render correctly on the server, they must be SSR-compatible. The platform automatically detects common issues and provides guidance on how to fix them.

Common SSR Issues

❌ Errors (Will prevent SSR)
  • window/document access during render: Browser APIs are not available during server-side rendering.
    ❌ Bad: window.innerWidth
    ✅ Good: typeof window !== "undefined" ? window.innerWidth : 0
    ✅ Better: Move to useEffect/useCallback
  • localStorage/sessionStorage access: Storage APIs are browser-only.
    ❌ Bad: localStorage.getItem('key')
    ✅ Good: useEffect(() => { const value = localStorage.getItem('key'); ... }, [])
⚠️ Warnings (May cause hydration mismatches)
  • Math.random() in render: Produces different values on server vs client, causing hydration mismatches.
    ❌ Bad: value: Math.floor(Math.random() * 1000)
    ✅ Good: Use a seeded random number generator
    // Seeded random for SSR compatibility
    function seededRandom(seed) {
      const a = 1664525;
      const c = 1013904223;
      const m = Math.pow(2, 32);
      return ((seed * a + c) % m) / m;
    }
    
    // Use index as seed for deterministic values
    const value = Math.floor(seededRandom(i * 2) * 1000);
  • Date.now() or new Date() without arguments: Current time differs between server and client.
    ❌ Bad: const now = Date.now()
    ✅ Good: useEffect(() => { setNow(Date.now()); }, [])
    ✅ Better: Accept date as prop or use deterministic date
  • crypto.randomUUID() or crypto.getRandomValues(): Non-deterministic values cause mismatches.
    ❌ Bad: const id = crypto.randomUUID()
    ✅ Good: useEffect(() => { setId(crypto.randomUUID()); }, [])

Best Practices

  • Move browser-only code to useEffect/useCallback: These hooks only run on the client after hydration.
  • Use deterministic data generation: For mock data, use seeded random generators or accept data as props.
  • Guard browser APIs: Always check typeof window !== "undefined" before accessing browser APIs.
  • Test SSR output: Check "View Source" in your browser to verify SSR HTML is present.

Component Structure Requirements

  • Default export of a React component
  • Props defined as function parameters
  • JSX return statement
  • SSR-safe render: avoid browser-only APIs during render (unless guarded)
  • Hooks are fine - effects run on the client after hydration
  • CSS is bundled into a versioned style.css. Tailwind utility classes are supported in embeds via a Tailwind CDN safety net.
  • Production dependencies are validated for security during upload

Component Structure

WP Render Blocks supports standard React components with a few requirements:

  • Default export of a React component
  • Props defined as function parameters
  • JSX return statement
  • SSR-safe render: avoid browser-only APIs during render (see SSR Compatibility section below)
  • Hooks are fine - effects run on the client after hydration
  • CSS is bundled into a versioned style.css. Tailwind utility classes are supported in embeds via a Tailwind CDN safety net.
  • Production dependencies are validated for security during upload

Props and Configuration

Components receive props from the WordPress editor. Define your props schema in the component configuration:

Supported Prop Types

  • string - Text inputs
  • number - Number inputs
  • boolean - Checkboxes
  • array - Lists and arrays
  • object - Complex nested data

Best Practices

  • Keep components pure: Avoid side effects and external API calls during render
  • Use semantic HTML: Helps with SEO and accessibility
  • Optimize images: Use optimized image formats and proper sizing
  • Test locally first: Test components in a React environment before uploading
  • Version control: Use meaningful version numbers for easy rollback

Need Help?

Can't find what you're looking for? We're here to help. Explore live examples, use cases, or pricing.