/refine-frappe-provider

🙏 Integration for Frappe Framework with Refine

Primary LanguageTypeScriptMIT LicenseMIT

Integration for Frappe Framework with Refine

The refine-frappe-provider serves as a comprehensive data, access control, and authentication provider for Refine, facilitating effortless integration with the Frappe Framework.

Frappe is a full stack, batteries-included, web framework written in Python and Javascript.

Refine is a React-based framework for building internal tools, rapidly.

Install

npm i refine-frappe-provider

Usage

// App.tsx

import { Refine } from "@refinedev/core";

import {
  accessControlProvider,
  authProvider,
  dataProvider,
  type ClientParams,
} from "refine-frappe-provider";

const providerConfig = {
  url: 'https://frappe-server-url.com',
} satisfies ClientParams;

const App = () => (
  <Refine
    /* ... */
    accessControlProvider={
      accessControlProvider(providerConfig)
    }
    authProvider={
      authProvider(providerConfig)
    }
    dataProvider={
      dataProvider(providerConfig)
    }
  />
);

Important Notes

  • Ensure that the response from the Frappe server is configured to set cookies correctly on the Refine site. This requires proper configuration of Cross-Origin Resource Sharing (CORS) settings.

License

This project is licensed under the MIT License.