@doldigital/ra-data-strapi3

3.3.4 • Public • Published

@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;

Readme

Keywords

none

Package Sidebar

Install

npm i @doldigital/ra-data-strapi3

Weekly Downloads

8

Version

3.3.4

License

MIT

Unpacked Size

17.6 kB

Total Files

9

Last publish

Collaborators

  • felixyorke
  • l.pressello
  • preluigi