Registry / crm / fuel-rest

fuel-rest

JSON →
library3.2.2jsnpmunverified

Low-level Node.js library for accessing the Salesforce Marketing Cloud REST API (formerly ExactTarget). Version 3.2.2 supports Node >=4 and uses the 'request' module for HTTP calls. The community-supported project is maintained on GitHub. It provides simple GET, POST, PUT, PATCH, DELETE methods with optional retry on 401 responses. Alternative to the full FuelSDK for targeted REST calls. Release cadence: irregular, last release 2019-09-25. No ES modules, no TypeScript types. Primarily used in older Node projects integrating with Marketing Cloud.

crm
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Package is CJS-only, no ESM exports. Default export is the constructor function.

const FuelRest = require('fuel-rest');

You must use 'new' keyword. Options object with 'auth' property is required.

const client = new FuelRest({ auth: { clientId: 'id', clientSecret: 'secret' }});

First argument must be an options object, not a string URI. Support both callback and promise, but not both.

client.get(options).then(resp => ...);

Initializes the FuelRest client with client credentials and sends a POST request to the Marketing Cloud messaging API.

const FuelRest = require('fuel-rest'); const client = new FuelRest({ auth: { clientId: process.env.SFMC_CLIENT_ID ?? '', clientSecret: process.env.SFMC_CLIENT_SECRET ?? '' } }); client.post({ uri: '/messaging/v1/messages', body: { definitionKey: 'myDefinition', recipients: [{ contactKey: 'test@example.com' }] } }).then(response => { console.log(response.body); }).catch(err => { console.error(err); });
Debug
Known footguns
deprecatedThe underlying 'request' module is deprecated. Do not use this library for new projects.
breakingNode.js >=4 required. Will fail on Node <4.
gotchaYou cannot use both callbacks and promises on the same method call - unexpected behavior.
gotcha'origin' must not have a trailing slash. e.g., 'https://www.exacttargetapis.com' not 'https://www.exacttargetapis.com/'.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
26 hits · last 30 days
gptbot
3
amazonbot
3
bytedance
3
ahrefsbot
1
Resources