npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ra-data-woocommerce

v1.1.5

Published

WooCommerce REST API data provider for react-admin

Downloads

40

Readme

Woocommerce REST API Data Provider For React-Admin

Woocommerce REST API Data Provider for react-admin, the frontend framework for building admin applications on top of REST/GraphQL services.

Installation

npm install --save ra-data-woocommerce

or

yarn add ra-data-woocommerce

REST Dialect

This Data Provider fits REST APIs powered by Woocommerce REST API

| Method | API calls | | ------------------ | -----------------------------------------------------------------------------------------------------------------------------| | getList | GET https://example.com/orders?order=asc&page=1&per_page=10&search=example&status=completed | | getOne | GET https://example.com/orders/123 | | getMany | GET https://example.com/orders?include=123,456,789 | | getManyReference | GET https://example.com/orders/123/notes | | create | POST https://example.com/orders | | update | PUT https://example.com/orders/123 | | updateMany | PUT https://example.com/orders/123, PUT http://example.com/orders/456, PUT http://example.com/orders/789 | | delete | DELETE https://example.com/orders/123 | | deleteMany | DELETE https://example.com/orders/123, DELETE https://example.com/orders/456, DELETE https://example.com/orders/789 |

If your API is on another domain as the JS code, you'll need to whitelist this header with an Access-Control-Expose-Headers CORS header.

You need to allow access to the your IP number, from the firewall settings (whitelist - allowlist) of your server where your WooCommerce site is located.

Usage

// in src/App.js
import { Admin, Resource, ListGuesser, EditGuesser } from 'react-admin';
import woocommerceData from 'ra-data-woocommerce';

const dataProvider = woocommerceData({
    woocommerceUrl: 'https://example.com',
    consumerKey: 'ck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
    consumerSecret: 'cs_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
})

const App = () => (
    <Admin dataProvider={dataProvider}>
        <Resource name="orders" list={ListGuesser} edit={EditGuesser} />
        <Resource name="customers" list={ListGuesser} edit={EditGuesser} />
    </Admin>
);

export default App;

License

This data provider is licensed under the MIT License, and sponsored by RAYS.