Praxent CRM Package
This package is to assist in the sending of information to your specified CRM. Right now this package is only built out for HubSpot but future iterations could expand that scope.
How to Use
HubSpot Integration
You can use the package as follows:
const HubspotIntegration = require('@praxent/praxent-crm')
async exampleFunction() => {
try {
const hubspotIntegration = HubspotIntegration({ apiKey }) // appId required for webhooks
const response = await hubspotIntegration.fetch({ action: 'createContact', data })
return {
success: true,
data: response,
}
} catch(error) {
console.warn(error)
return {
success: false,
error,
}
}
}
The data variable is whatever data you want to send to HubSpot formatted for your specific project.
Actions Types:
createContact
{
properties: [
{
property: string,
value: any,
}
...
]
}
createDeal
{
associations: {
associatedVids: [int],
},
properties: [
{
name: string,
value: any,
}
...
]
}
searchContactByEmail
{
email: string,
}
viewSettings
{}
updateSettings
{
webhookUrl: string, // requires https
maxConcurrentRequests: int, // greater than 5
}
createSubscriptions
{
subscriptionDetails: {
subscriptionType: string,
propertyName: string,
},
enabled: bool,
}
getSubscriptions
{}
updateSubscriptions
{
subscriptionId: int,
data: {
enabled: bool,
}
}
deleteSubscriptions
{}