Skip to content

A data provider for React Admin that integrates with JamBFF APIs.

Notifications You must be signed in to change notification settings

jambff/ra-data-provider

Repository files navigation

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 });