https://github.com/mapp-digital/mapp-connect-client-js
Mapp Connect Client node.js
https://github.com/mapp-digital/mapp-connect-client-js
Last synced: 8 months ago
JSON representation
Mapp Connect Client node.js
- Host: GitHub
- URL: https://github.com/mapp-digital/mapp-connect-client-js
- Owner: mapp-digital
- License: mit
- Created: 2021-08-26T11:27:13.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-10-05T12:15:24.000Z (over 4 years ago)
- Last Synced: 2025-01-12T00:47:40.998Z (over 1 year ago)
- Language: JavaScript
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mapp-connect-client-js
Mapp Connect Client node.js
This library can be used by any application that wants to communicate with Mapp Connect. It wraps up JWT token generation part and all the HTTP communication details.
It's being packaged with NPM, in order to use it, just add it to the project as a dependency (mapp-connect-client).
Example usage
Instantiate client and specify API URL, integration ID and API key
var mcc = new lib.MappConnectClient('https://charon-test.shortest-route.com', 'fc1dd232-8302-41a0-a7e9-089d9f8f7304', 'fQbl8bQz1G9OYYukcgYypy2jJeOCi0FD')
## Get list of prepared messages
let getMessagesCallback = function (data) {
console.log(data);
}
mcc.getMessages(getMessagesCallback);
## Get list of groups
let getGroupsCallback = function (data) {
console.log(data);
}
mcc.getGroups(getGroupsCallback);
## Send contact profile to be processed by Mapp Connect and saved by Engage
mcc.sendUser("{\"email\":\"test@xx.xx\"}");
Each operation can be triggered by sendXxxx method on the client, for now each of them expects the full JSON payload to be provided as an argument:
*Email
*Sms
*Push
*Transaction
*Automation
# Check list of API's in right menu to check required fields for every event.