@jambff/ra-data-provider
v1.2.1
Published
A data provider for React Admin that integrates with JamBFF APIs.
Downloads
31
Readme
React Admin Data Provider
A data provider for React Admin that integrates with JamBFF APIs.
Installation
yarn add @jambff/ra-data-provider
Usage
import { createDataProvider } from '@jambff/data-provider';
const dataProvider = createDataProvider('http://api.example.com');
Authentication
If you need to make authenticated requests you can override the fetch client, for example:
import { createDataProvider } from '@jambff/data-provider';
import { createClient } from '@supabase/supabase-js';
import { createAuthenticatedFetch } from '@jambff/supabase-auth-fetch';
const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_ANON_KEY);
const fetch = createAuthenticatedFetch(supabase);
const dataProvider = createDataProvider('http://api.example.com', { fetch });