(userConfig)
| 15 | |
| 16 | /* Export the integration */ |
| 17 | export 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected