@seneca/mixpanel-provider
v0.3.1
Published
Seneca entity provider for the Mixpanel API.
Downloads
4
Readme
Seneca Mixpanel-Provider is a plugin for Seneca
Provides access to the Mixpanel API using the Seneca provider convention. Mixpanel API entities are represented as Seneca entities so that they can be accessed using the Seneca entity API and messages.
See seneca-entity and the Seneca Data Entities Tutorial for more details on the Seneca entity API.
NOTE: underlying third party SDK needs to be replaced as out of date and has a security issue.
| | This open source module is sponsored and supported by Voxgig. | |---|---|
Quick Example
// Setup - get the key value (<SECRET>) separately from a vault or
// environment variable.
Seneca()
// Get API keys using the seneca-env plugin
.use('env', {
var: {
$MIXPANEL_APIKEY: String,
$MIXPANEL_USERTOKEN: String,
}
})
.use('provider', {
provider: {
mixpanel: {
keys: {
apikey: { value: '$MIXPANEL_APIKEY' },
usertoken: { value: '$MIXPANEL_USERTOKEN' },
}
}
}
})
.use('mixpanel-provider')
let board = await seneca.entity('provider/mixpanel/board')
.load$('<mixpanel-board-id>')
Console.log('BOARD', board)
board.desc = 'New description'
board = await board.save$()
Console.log('UPDATED BOARD', board)
Install
$ npm install @seneca/mixpanel-provider @seneca/env
Options
debug
: boolean false
Set plugin options when loading with:
seneca.use('MixpanelProvider', { name: value, ... })
Note: foo.bar in the list above means { foo: { bar: ... } }
Action Patterns
- role:entity,base:mixpanel,cmd:load,name:repo,zone:provider
- role:entity,base:mixpanel,cmd:save,name:repo,zone:provider
- sys:provider,get:info,provider:mixpanel
Action Descriptions
« role:entity,base:mixpanel,cmd:load,name:repo,zone:provider
»
Load Mixpanel repository data into an entity.
« role:entity,base:mixpanel,cmd:save,name:repo,zone:provider
»
Update Mixpanel repository data from an entity.
« sys:provider,get:info,provider:mixpanel
»
Get information about the provider.