Simple REST data provider for react-admin, version 5.14.7. It maps react-admin CRUD queries to a REST API with a specific dialect: GET parameters for sorting, range, and filtering, and PUT for updates. The package is maintained as part of the react-admin ecosystem, with regular releases aligned with react-admin v5. It provides a straightforward bridge between react-admin and any REST API following the simple REST conventions (similar to FakeRest). Key differentiator: minimal configuration, just pass the API URL and optional custom HTTP client. Compared to ra-data-json-server, it offers more flexibility in URL structure and supports custom identifiers.
npm install ra-data-simple-restNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up a react-admin app with a simple REST backend using ra-data-simple-rest.
If your API returns { data: [...] }, wrap it: const httpClient = (url, options) => fetchUtils.fetchJson(url, options).then(({ json }) => json.data);Override update method or use a custom HTTP client that changes the method to PATCH.
Use import syntax or upgrade to a bundler that supports ESM.
Ensure your custom HTTP client rejects on HTTP errors, or handle them in the provider.
Implement a custom deleteMany that sends a single batch DELETE request if your API supports it.
Check the API URL and response; use a custom HTTP client with error handling.
Ensure auth provider stores token in localStorage under 'auth' key before accessing data provider.
Enable CORS on the API server or use a proxy in development.