
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
@yoctol/analytics
Advanced tools
$ npm install @yoctol/analytics
$ npm install @yoctol/analytics-sdk
First install sdk and log data into bot db using monk or knex client. Then analytics can generate corresponding files based on report setting.
interactionLogs
interaction_logs
switchToHumanPayloads
only supported in messenger platform.reporterSettings: [
{
title: '總覽',
className: 'Statistics',
config: {
switchToHumanPayloads: {
postback: ['__SWITCH_TO_HUMAN__'],
quick_reply: ['__SWITCH_TO_HUMAN__', '__INTENT_轉接專人__'],
},
},
},
{
title: '互動次數(每日)',
className: 'Histogram',
config: {
switchToHumanPayloads: {
postback: ['__SWITCH_TO_HUMAN__'],
quick_reply: ['__SWITCH_TO_HUMAN__', '__INTENT_轉接專人__'],
},
periodMinutes: 24 * 60,
},
},
{
title: '互動次數(每小時)',
className: 'Histogram',
config: {
switchToHumanPayloads: {
postback: ['__SWITCH_TO_HUMAN__'],
quick_reply: ['__SWITCH_TO_HUMAN__', '__INTENT_轉接專人__'],
},
periodMinutes: 60,
},
},
{
title: '按鈕觸發次數',
className: 'Postback',
config: {},
},
{
title: '訊息記錄',
className: 'Log',
config: {},
},
],
}
const logger = new AnalyticsLogger({ knexClient, monkClient, logDbName });
logger.insertLog({ id, platform, platformChannelId, direction, event, triggers })
id
: request idplatform
: line / messenger / universalplatformChannelId
: bot binding channel/page idkuratorProjectId
: optional (special case for Fubon){
id,
platform,
platformChannelId,
direction,
event,
triggers,
kuratorProjectId
}
triggers: trigger | [trigger] // single object or array of objects
trigger: {
intentId: "NLU INTENT ID",
intentName: "NLU INTENT NAME",
entityId: "NLU ENTITY ID",
entityName: "NLU ENTITY NAME",
entityValueId: "NLU ENTITY VALUE ID",
entityValueName: "NLU ENTITY VALUE NAME",
regexp: "^REGEXP$/g",
keywords: ["KEYWORD1", "KEYWORD2", "KEYWORD3"],
displayName: "ACTION NAME WHEN TRIGGERED BY PAYLOAD OR UNKNOWN",
actionId: "ACTION ID WHEN TRIGGERED BY PAYLOAD OR UNKNOWN"
isFallback: Boolean // unknown or not
}
rawEvent
{
id: STRING (uuid)
direction: STRING ('incoming' | 'outgoing')
type: STRING ('text' | 'quick_reply' | 'button' | ...)
platform: STRING ('messenger' | 'line' | 'universal' | ...)
text: STRING
postback: STRING
context: {
trigger: JSON
... extendibleFields
},
raw: JSON
... extendibleFields
}
FAQs
Analytics for Yoctol bots
The npm package @yoctol/analytics receives a total of 18 weekly downloads. As such, @yoctol/analytics popularity was classified as not popular.
We found that @yoctol/analytics demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.