Skip to content

Headless Frappe
for WordPress

Connect Frappe DocTypes to WordPress interfaces with @wordpress/data using React hooks.

import { useFrappeResourceList } from '@lubusin/wp-frappe-data-store';
import { frappeStore } from './store';

export function CRMDealsTable() {
  const { resources, isResolving, error } = useFrappeResourceList(
    frappeStore, 
    'CRM Deal', 
    { fields: ['deal_name', 'status', 'deal_value'], limit: 5 }
  );

  if (isResolving && !resources) return <div>Loading deals...</div>;
  if (error) return <div>Failed to fetch deals.</div>;

  return (
    <ul class="deals-list">
      {resources?.map((deal) => (
        <li key={deal.deal_name}>
          <strong>{deal.deal_name}</strong> — ${deal.deal_value}
        </li>
      ))}
    </ul>
  );
}
Rendered Preview
  • Acme Cloud MigrationFrappe CRM • Deal
    Open$45,000
  • Global Retail POS IntegrationFrappe CRM • Deal
    Quotation$18,200

Reactive Data Querying

useFrappeResourceList and useFrappeResource resolve data synchronously when available in cache while triggering background revalidation.

@wordpress/data Engine

Built on WordPress's Redux state management engine (frappe/resources by default). Shares cached records and deduplicates requests across components.

Schema Normalization

Inspect metadata with useFrappeDocType to automatically derive structured definitions for form controls, select options, and validation rules.

REST Proxy & Multi-Auth

Connect via session cookies or route calls through WordPress REST proxy endpoints (`X-WP-Nonce`) to keep API tokens securely on the server.

Starter Templates

Reference architectures for building WordPress plugins and standalone web applications with Frappe backend integration.

Start using WP Frappe Data Store

Install the package via npm and configure your first store.

bash
npm install @lubusin/wp-frappe-data-store @wordpress/data react

Released under the MIT License.