MCPcopy Create free account
hub / github.com/DavidWells/analytics / analyticPlugin

Function analyticPlugin

packages/plugin-template/src/node.js:17–47  ·  view source on GitHub ↗
(userConfig)

Source from the content-addressed store, hash-verified

15
16/* Export the integration */
17export default function analyticPlugin(userConfig) {
18 // Allow for userland overides of base methods
19 return {
20 name: 'plugin-name',
21 config: {
22 ...config,
23 ...userConfig
24 },
25 initialize: ({ config }) => {
26 /* initialize client */
27 client = sdk('xyz')
28 },
29 /* page view */
30 page: ({ payload, config }) => {
31 console.log('Run pageview in node')
32 client.page()
33 },
34 /* track event */
35 track: ({ payload, config }) => {
36 console.log('track event in node')
37 client.track()
38 },
39 /* identify user */
40 identify: ({ payload }) => {
41 console.log('identify user in node')
42 client.identify()
43 },
44 /* Not needed in node */
45 // loaded: () {}
46 }
47}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected