sfmc-easy-connect
v0.2.3
Published
SFMCeasyConnect is a custom sdk for sfmc
Downloads
20
Maintainers
Readme
easyConnectSFMC
Salesforce Marketing Cloud node SDK
Overview
The Fuel SDK for Node provides easy access to Salesforce Marketing Cloud's API endoints.
API´s supported REST & SOAP SFMC
How to use
Step 1. Install the package
npm install --save sfmc-easy-connect
Step 2. Require the package
// require mode
const { easyConnectSFMC } = require("sfmc-easy-connect");
// module mode
import { easyConnectSFMC } from "sfmc-easy-connect";
Step 3. Instantiate the SDK
const urlTenant = id_tenant; // https://id_tenant.auth.marketingcloudapis.com
const apiKey = "YOUT-API-KEY";
const connection = new easyConnectSFMC(
idClient,
secretId,
account,
urlTenant,
apiKey
);
Step 4. use functionalities
You can use the functionalities keeping in mind that they are all asynchronous
//Promise
const token = connection.auth
.getAuth()
.then((token) => token)
.catch((err) => err);
//async await
try {
const data = await connection.auth.getAuth();
} catch (err) {
// todo err
}
Functionalities
Current functionalities
- Auth (token, refreshToken, getActualUser, getUserInfo)
- dataFolder (create, delete, update, getFolder, getFolders)
- dataExtension (create, addColumn, clearInfo, delete, getByKey, getByName, datasByKey, datasByName)
- journey (getById, deleteUser)
- contact (getActiveJourneys, create, update, delete, deletionProcess)
Functionalities under development
- DataRows
- Automations
- Automation Activities
- Jouneys
- Subscribers
- Contacts (update atributes)