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>
);
}useFrappeResourceList and useFrappeResource resolve data synchronously when available in cache while triggering background revalidation.
Built on WordPress's Redux state management engine (frappe/resources by default). Shares cached records and deduplicates requests across components.
Inspect metadata with useFrappeDocType to automatically derive structured definitions for form controls, select options, and validation rules.
Connect via session cookies or route calls through WordPress REST proxy endpoints (`X-WP-Nonce`) to keep API tokens securely on the server.
Reference architectures for building WordPress plugins and standalone web applications with Frappe backend integration.
Admin sidebar navigation across Frappe CRM entities (@wordpress/boot), server-side REST proxying, and instant testing with WordPress Playground (npm run playground).
Standalone SPA built with WordPress DataViews (@wordpress/dataviews), dynamic DocType form generation, Vite local development server, and Vitest testing harness.
Install the package via npm and configure your first store.
npm install @lubusin/wp-frappe-data-store @wordpress/data react