New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fetch-salesforce

Package Overview
Dependencies
Maintainers
3
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fetch-salesforce

A client for Salesforce using React Native friendly Fetch requests.

  • 2.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
13
decreased by-59.37%
Maintainers
3
Weekly downloads
 
Created
Source

fetch-salesforce

fetch-salesforce is a wrapper for the Salesforce.com REST API using the Fetch API. This library was initially developed to be used in React Native projects that needed to access the Salesforce API, but it can be used in any environment that supports fetch.

Build Status Coverage Status

Install

yarn add fetch-salesforce

Usage

Setup

import { SalesforceOptions, FetchSalesforce } from "fetch-salesforce";
const options: any = {
  clientID: "",
  authorizationServiceURL: "",
  tokenServiceURL: "",
  redirectUri: "",
  apiVersion: 39.0,
  logLevel: "DEBUG",
};

const fetchSalesforce = new FetchSalesforce(options);

Insert

fetchSalesforce.fetchSObject
  .insert("Account", {
    Name: "My Account",
  })
  .then(res => {
    console.log(res);
  });

Query

fetchSalesforce.fetchQuery
  .query("SELECT ID FROM Account LIMIT 10")
  .then(res => {
    console.log(res);
  });

... you get the idea!

My target doesn't support fetch

Use a library like cross-fetch to polyfill/ponyfill it:

$ yarn add cross-fetch

As a ponyfill:

import fetch from "cross-fetch";

As a polyfill:

import "cross-fetch/polyfill";

Developing fetch-salesforce

Install

git clone https://github.com/kidtsunami/fetch-salesforce
cd fetch-salesforce

Compiling

tsc

Running Tests

yarn test

FAQs

Package last updated on 29 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc