Seneca Hubspot-Provider is a plugin for Seneca
Provides access to the Hubspot API using the Seneca provider convention. Hubspot API entities are represented as Seneca entities so that they can be accessed using the Seneca entity API and messages.
This open source module is sponsored and supported by Voxgig. |
---|
// Setup - get the key value (<SECRET>) separately from a vault or
// environment variable.
Seneca()
.use('env', { // the 'env' plugin enables you to use environment variables in your Seneca instance.
// debug: true,
file: [__dirname + '/local-env.js;?'], // you can specify the file with your company's data such as id, etc.
var: {
$HUBSPOT_ACCESS_TOKEN: '<SECRET>',
}
})
.use('provider', {
provider: {
hubspot: {
keys: {
accessToken: {
value: '$HUBSPOT_ACCESS_TOKEN'
},
}
}
}
})
.use('hubspot-provider')
let companyId = await seneca.entity('provider/hubspot/company')
.load$('id')
// .load({id: 'id', fields$: ['state', 'city', 'description']}); // you can use fields$_directive to specify the properties you want to get from a company
Console.log('COMPANY DATA', companyId)
companyId.properties.description = 'New description'
companyId = await companyId.save$()
Console.log('UPDATED DATA', companyId)
$ npm install @seneca/hubspot-provider
None.
- "role":"entity","base":"hubspot","cmd":"list","name":"company","zone":"provider"
- "role":"entity","base":"hubspot","cmd":"load","name":"company","zone":"provider"
- "role":"entity","base":"hubspot","cmd":"save","name":"company","zone":"provider"
- "sys":"provider","get":"info","provider":"hubspot"
List Hubspot data into an entity.
Load Hubspot data into an entity.
Update/Save Hubspot data into an entity
Get information about the provider.