Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@splitmedialabs/node-crisp-api
Advanced tools
npm install --save node-crisp-api
To authenticate against the API, generate your session identifier and session key once using the Crisp token generation utility. You'll get a token keypair made of 2 values.
Keep your token keypair values private, and store them safely for long-term use.
Then, add authentication parameters to your client
instance right after you create it:
var Crisp = require("node-crisp-api");
var CrispClient = new Crisp();
// Authenticate to API (identifier, key)
// eg. CrispClient.authenticate("7c3ef21c-1e04-41ce-8c06-5605c346f73e", "cc29e1a5086e428fcc6a697d5837a66d82808e65c5cce006fbf2191ceea80a0a");
CrispClient.authenticate(identifier, key);
// Now, you can use authenticated API sections.
🔴 Important: Make sure to generate your token once, and use the same token keys in all your subsequent requests to the API. Do not generate too many tokens, as we may invalidate your older tokens to make room for newer tokens.
var Crisp = require("node-crisp-api");
var CrispClient = new Crisp();
CrispClient.authenticate(identifier, key);
CrispClient.userProfile.get().then(function(myProfile) {
console.log("Hello " + myProfile.first_name);
});
var Crisp = require("node-crisp-api");
var CrispClient = new Crisp();
CrispClient.authenticate(identifier, key);
// Notice: make sure to authenticate before listening for an event
CrispClient.on("message:send", function(message) {
CrispClient.websiteConversations.sendMessage(
message.website_id,
message.session_id, {
type : "text",
content : "I'm a bot",
from : "operator", //or user
origin : "chat"
}
);
});
Where you see params
it is a plain JavaScript object, e.g. { email: 'foo@example.com' }
Website Conversations
CrispClient.websiteConversations.getList(websiteId, page)
CrispClient.websiteConversations.getOne(websiteId, sessionId)
CrispClient.websiteConversations.getMeta(websiteId, sessionId)
CrispClient.websiteConversations.updateMeta(websiteId, sessionId, params)
CrispClient.websiteConversations.getMessages(websiteId, sessionId, query)
CrispClient.websiteConversations.create(websiteId)
CrispClient.websiteConversations.initiateOne(websiteId, sessionId)
CrispClient.websiteConversations.sendMessage(websiteId, sessionId, message)
CrispClient.websiteConversations.setState(websiteId, sessionId, state)
CrispClient.websiteConversations.getRouting(websiteId, sessionId)
CrispClient.websiteConversations.setRouting(websiteId, sessionId, assign)
CrispClient.websiteConversations.setBlock(websiteId, sessionId, blocked)
CrispClient.websiteConversations.deleteOne(websiteId, sessionId)
CrispClient.websiteConversations.acknowledgeMessages(websiteId, sessionId, from, origin, fingerprints)
Website People (These are your End Users).
The PeopleID argument can be an email or the PeopleID.
Find By Email: CrispClient.websitePeople.findByEmail(websiteId, email)
Check By Segments: CrispClient.websitePeople.findBySegments(websiteId, segments)
Create A New Profile: CrispClient.websitePeople.createNewPeopleProfile(websiteId, params)
Check If Exists: CrispClient.websitePeople.checkPeopleProfileExists(websiteId, peopleId)
Get People Profile: CrispClient.websitePeople.getPeopleProfile(websiteId, peopleId)
List People Profiles: CrispClient.websitePeople.listPeopleProfiles(websiteId, peopleId, page)
Remove A Profile: CrispClient.websitePeople.removePeopleProfile(websiteId, peopleId)
Save A Profile: CrispClient.websitePeople.savePeopleProfile(websiteId, peopleId, params)
Update A Profile: CrispClient.websitePeople.updatePeopleProfile(websiteId, peopleId, params)
List Segments: CrispClient.websitePeople.listPeopleSegments(websiteId, peopleId, page)
List Conversations: CrispClient.websitePeople.listPeopleConversations(websiteId, peopleId, page)
Add Event: CrispClient.websitePeople.addPeopleEvent(websiteId, peopleId, params)
List Events: CrispClient.websitePeople.listPeopleEvent(websiteId, peopleId, page)
Get Data: CrispClient.websitePeople.getPeopleData(websiteId, peopleId)
Update Data: CrispClient.websitePeople.updatePeopleData(websiteId, peopleId, params)
Get Subscription Status: CrispClient.websitePeople.getPeopleSubscriptionStatus(websiteId, peopleId)
Update Subscription Status: CrispClient.websitePeople.updatePeopleSubscriptionStatus(websiteId, peopleId, params)
Website Base
CrispClient.website.create(params)
Website Settings
CrispClient.websiteSettings.get(websiteId)
CrispClient.websiteSettings.get(params)
Website Operators
CrispClient.websiteOperators.getList(websiteId)
CrispClient.websiteOperators.getOne(websiteId, operatorId)
CrispClient.websiteOperators.deleteOne(websiteId, operatorId)
CrispClient.websiteOperators.createOne(websiteId, parameters)
CrispClient.websiteOperators.updateOne(websiteId, operatorId, parameters)
Available events are listed below:
Session Events
session:update_availability
session:update_verify
session:request:initiated
session:set_email
session:set_phone
session:set_address
session:set_avatar
session:set_nickname
session:set_data
session:sync:pages
session:sync:events
session:sync:capabilities
session:sync:geolocation
session:sync:system
session:sync:network
session:sync:timezone
session:sync:locales
session:set_state
session:set_block
session:set_segments
session:set_opened
session:set_closed
session:set_mentions
session:set_routing
session:removed
Message Events
message:updated
message:send
message:received
message:compose:send
message:compose:receive
message:acknowledge:read:send
message:acknowledge:read:received
message:acknowledge:delivered
message:notify:unread:send
message:notify:unread:received
People Events
people:profile:created
people:profile:removed
people:bind:session
people:sync:profile
people:import:progress
people:import:done
Campaign Events
campaign:progress
campaign:dispatched
campaign:running
Browsing Events
browsing:request:initiated
browsing:request:rejected
Call Events
call:request:initiated
call:request:rejected
Status Events
status:health:changed
Website Events
website:update_visitors_count
website:update_operators_availability
website:users:available
Bucket Events
bucket:url:upload:generated
bucket:url:avatar:generated
bucket:url:website:generated
bucket:url:campaign:generated
bucket:url:helpdesk:generated
bucket:url:status:generated
bucket:url:processing:generated
Media Events
media:animation:listed
Email Events
email:subscribe
email:track:view
Plugin Events
plugin:channel
plugin:event
plugin:settings:saved
FAQs
Crisp API Node Wrapper
We found that @splitmedialabs/node-crisp-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.