
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@botpress/analytics
Advanced tools
Provides high level analytics about your bot usage.
Analytics for Botpress provides an interface to view graphs and data of your chatbot typical usage. By using this module, you can have a look to your total users, retention, daily active users, busy hours and a lot more...
npm install --save @botpress/analytics
This module has some built-in analytics available from the box but also allows you to set up your own custom analytics.
For latter you need to:
bp.analytics.custom.addGraph
bp.analytics.custom.increment(name, count=1)
and bp.analytics.custom.set(name, count=1)
to register events that get displayed in analyticsbp.analytics.custom.addGraph
accepts an object with following keys:
If you need some statistics about the satisfaction of your users, you can create 3 graphs : 2 counts and 1 table.
To generate your graphs, create a new file inside src
folder called analytics.js
.
Inside this file, call the addGraph()
function :
module.exports = async bp => {
bp.analytics.custom.addGraph({
name: '😃 users',
type: 'count',
description: 'Happy users',
variables: ['happy']
})
bp.analytics.custom.addGraph({
name: '😕 users',
type: 'count',
description: 'Mad users',
variables: ['mad']
})
bp.analytics.custom.addGraph({
name: 'Unsatisfied reasons',
type: 'table',
description: 'Why your users are mad?',
variables: ['reason']
})
}
and then you can call the analytics.js
file inside the index.js
file :
const registerAnalytics = require('./analytics')
module.exports = async bp => {
// ...
// register functions
// ...
await registerAnalytics(bp)
}
To send events, create nodes that passes inside functions that calls the botpress customs analytics functions :
Examples of functions inside the actions.js
file :
module.exports = {
userIsHappy: async (state, { bp, user }, params) => {
await bp.analytics.custom.increment(`happy~${user.id}`);
},
userIsMad: async (state, { bp, user }, params) => {
await bp.analytics.custom.increment(`mad~${user.id}`);
},
satisfactionReason: async (state, event, { bp, user }) => {
await bp.analytics.custom.set(`${event.text}~reason~${user.id}`);
}
}
For more details, please read the documentation.
botpress-analytics is licensed under AGPL-3.0
FAQs
Provides high level analytics about your bot usage.
The npm package @botpress/analytics receives a total of 0 weekly downloads. As such, @botpress/analytics popularity was classified as not popular.
We found that @botpress/analytics demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.