Home - The-Commit-Company/frappe-react-sdk GitHub Wiki
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
- Uploading files
Miscellaneous
- Using SWR
- Using frappe-js-sdk in frappe-react-sdk directly
FAQs
- How to use the SWR configuration?
- How to use caching in SWR (keys in SWR)?
- How do I only make a fetch/GET request conditionally instead of on mount?
- How do I stop unnecessary re-requests on focus/error?