0.1.0 • Published 4 years ago

@intofilm/salesforce-client v0.1.0

Weekly downloads
-
License
ISC
Repository
bitbucket
Last release
4 years ago

Oauthable Axios Salesforce HTTP client

Getting Started

Installation

$ npm install @intofilm/salesforce-client

Usage

const SalesforceClient = require("@intofilm/salesforce-client");

const args = {
  baseURL: "https://predator.my.salesforce.com/services/data/v49.0",
  client_id: "abcdefg1234567890",
  client_secret: "abcdefg1234567890",
  username: "test@example.com",
  password: "correct-horse-battery-staple",
  oauthURL: "https://test.salesforce.com"
};

const client = SalesforceClient.create(args);

client.get(/*<axios style args>*/).then((data) => {});

Where required (in an AWS Lambda for example) it's preferable to pass the client as a Promise.

const SalesforceClient = require("@intofilm/salesforce-client");

const clientPromise = SalesforceClient.promise({...});

clientPromise.then((client) => client.get(/*<axios style args>*/)).then();
0.1.0

4 years ago