Skip to content
Nikhil Kothari edited this page Apr 19, 2024 · 6 revisions

Welcome to the frappe-react-sdk documentation!

🚧 This documentation is still a work-in-progress. The sections below will be added as Wiki pages soon.

Authentication

  • Username and Password
  • OAuth
  • Support for 2FA
  • Authenticate using API Key/Token

Database Queries

Database hooks use the standard REST APIs that are available in Frappe framework for fetching and updating documents.

  • Fetching a list of documents - useFrappeGetDocList
  • Fetching a document (useFrappeGetDoc)
  • Creating a document (useFrappeCreateDoc)
  • Updating a document (useFrappeUpdateDoc)
  • Deleting a document (useFrappeDeleteDoc)
  • Getting number of documents (useFrappeGetDocCount)

API Calls

To make API calls to custom endpoints, you can use the following hooks:

  • useFrappeGetCall
  • useFrappePostCall
  • useFrappePutCall
  • useFrappeDeleteCall

Realtime Events

Frappe support realtime events over websockets via Socket.io . Frappe React SDK has first-class support for these socket events.

  • Listening to events
  • Subscribing to "DocType" events
  • Subscribing to "Document" events
  1. Uploading files

Miscellaneous

  1. Using SWR
  2. Using frappe-js-sdk in frappe-react-sdk directly

FAQs

  1. How to use the SWR configuration?
  2. How to use caching in SWR (keys in SWR)?
  3. How do I only make a fetch/GET request conditionally instead of on mount?
  4. How do I stop unnecessary re-requests on focus/error?
Clone this wiki locally