A client for the Salesforce REST API using the Fetch API. Current stable version is 2.0.1. The library is maintained and designed for React Native but works in any environment supporting fetch. It provides a simple interface for CRUD operations, queries, and authentication. Version 2.0 introduces breaking changes, including requiring fetch to be defined globally. Differentiators: lightweight, no heavy dependencies, TypeScript-first with full typings.
npm install fetch-salesforceNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to instantiate the client with required options and run a simple SOQL query.
Use cross-fetch or ensure your environment provides fetch. See the 'My target doesn't support fetch' section in the README.
Use ES module imports: import { FetchSalesforce, SalesforceOptions } from 'fetch-salesforce'.Use numeric log levels: 0 for DEBUG, 1 for INFO, 2 for WARN, 3 for ERROR.
Always pass apiVersion as a number: apiVersion: 58.0
Ensure the redirectUri string matches the Salesforce connected app configuration exactly.
Use a library like 'simple-oauth2' or implement a custom token refresh wrapper around FetchSalesforce.
Run 'npm install fetch-salesforce' or 'yarn add fetch-salesforce'. Ensure the import statement is correct.
Install and import 'cross-fetch' polyfill or ensure the environment provides fetch.
Switch to ES module import: import { FetchSalesforce } from 'fetch-salesforce'.Ensure you have instantiated FetchSalesforce with valid options and completed OAuth flow.