3.3.4 • Published 4 years ago

@doldigital/ra-data-strapi3 v3.3.4

Weekly downloads
8
License
MIT
Repository
-
Last release
4 years ago

@doldigital/ra-data-strapi3

A react-admin data provider for strapi using REST endpoints

Installation

yarn add @doldigital/ra-data-strapi

Then configure the data provider by passing the apiUrl parameter

import React from 'react'
import { Admin, Resource } from 'react-admin'
import { buildDataProvider } from '@doldigital/ra-data-strapi3'

const apiUrl = 'http://localhost:1337'

const adminProps = {
  dataProvider: buildDataProvider(apiUrl)
}

const App = props => {
  return (
    <Admin {...adminProps}>
      // your resources here
    </Admin>
  );
}

export default App;

Using the auth provider

You can use the Strapi authentication as the auth provider for react-admin

import React from 'react'
import { Admin, Resource } from 'react-admin'
import { buildDataProvider, buildAuthProvider } from '@doldigital/ra-data-strapi3'

const apiUrl = 'http://localhost:1337'

const adminProps = {
  dataProvider: buildDataProvider(apiUrl),
  authProvider: buildAuthProvider(apiUrl)
}

const App = props => {
  return (
    <Admin {...adminProps}>
      // your resources here
    </Admin>
  );
}

export default App;
3.3.4

4 years ago

3.3.3

4 years ago

3.3.2-doc.1

4 years ago

3.3.2

4 years ago

3.3.1-fix.1

4 years ago

3.3.1

4 years ago

3.1.2

4 years ago

3.0.0

4 years ago