{"_id":"@analytics/custify","_rev":"1-0a2eb931c64a4954fb093c1479747a30","name":"@analytics/custify","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@analytics/custify","version":"0.0.1","description":"Custify integration for 'analytics' module for browser & node","projectMeta":{"provider":{"name":"Custify","url":"https://www.custify.com/"},"platforms":{"browser":"./src/browser.js","node":"./src/node.js"}},"keywords":["analytics","analytics-project","analytics-plugin","custify"],"author":{"name":"Abisoye Atolagbe","email":"atolagbeabisoye@gmail.com"},"license":"MIT","scripts":{"docs":"node ../analytics-cli/bin/run docs","build":"node ../../scripts/build/index.js","watch":"node ../../scripts/build/_watch.js","release:patch":"npm version patch && npm publish","release:minor":"npm version minor && npm publish","release:major":"npm version major && npm publish","es":"../../node_modules/.bin/babel-node ./testBabel.js"},"main":"lib/analytics-plugin-custify.cjs.js","globalName":"analyticsCustify","jsnext:main":"lib/analytics-plugin-custify.es.js","module":"lib/analytics-plugin-custify.es.js","browser":{"./lib/analytics-plugin-custify.cjs.js":"./lib/analytics-plugin-custify.browser.cjs.js","./lib/analytics-plugin-custify.es.js":"./lib/analytics-plugin-custify.browser.es.js"},"homepage":"https://github.com/DavidWells/analytics#readme","repository":{"type":"git","url":"git+https://github.com/DavidWells/analytics.git"},"devDependencies":{"@babel/core":"^7.2.2","@babel/preset-env":"^7.3.1"},"dependencies":{"unfetch":"^4.2.0"},"gitHead":"05bbd03771e54498c8439444ea1ca8d7019c3a8f","bugs":{"url":"https://github.com/DavidWells/analytics/issues"},"_id":"@analytics/custify@0.0.1","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-pGxNhKwcfhatwYkAURbXItHMgQHFnvvBGX9ts/ojtaOYNWuTnQpn6Fk41vG6R1Lawrg/VNvPrU4658tw2hFtAg==","shasum":"a73c403bd05aa75f2612709ec47ab1094e8c4093","tarball":"https://registry.npmjs.org/@analytics/custify/-/custify-0.0.1.tgz","fileCount":8,"unpackedSize":41442,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGMgHlvwZ4rEIFkMZ4BBcDD34kwR656Tvw1tVn/lj+GqAiAHRGf/wwHqp3/ZLzof5CvduXDlLbqN2D4mEfaPAGNYQQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjaztNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqnDg//V7AmPTv6c3cdnDB48/Z+GsvO2Vbce43FNv4E362bXeVJ67Au\r\nSEALO88U0wsy9HyJ/CjsgBAfIbkl5pOb8gWaIQ90c21c2Bzwh9s8ngJfo7GD\r\n6eA/mWJaCyIfC7SorB+ZIdogmtwTgsviINaAU3O1D/MidsYb2lybQxKyItTR\r\nlx1nZtynCQsTwtEA625ntyG8LN3vv8bkDQodCFeFRaaNuzDHMfCZkcLnYkA/\r\nXeeoRFbqITyc9uWdiW/5RPHow7yBiTAB2BXaFkjGH8iJFLtx/kVfV+ECrSyP\r\nKHRbVvA5H57GhCeZTpBF0t6SJCvMYV/wHmUtn50weGRALlZ6ElsDaNtsS3kg\r\n6t4ZYpwHuby+XGgca0/9pdfRSIO+3ZzBjGL+4ySq2l995QSNzWisiwGau0B9\r\nO9mziZ0tNHkIV4EmAqFlm3xmOCeULAEw6dZV5xh6vD3F28PMy6SDF7qHOfMu\r\ni0H8rdhi2gWppAhV9TfT2Ox0wfp1RLwT7o1NzVW44pkZmSF41ZW8USifbdA3\r\nc3keQiYJJ6XlmYbb1qcAqm9ZRdaQ8s9otEClmn+XTCziAst1agCyGOP0AtMd\r\nNJ7iUygE9FN4q4aEmbqjUnGqtA2lqgradgABbE2atTIopAjtTO2y9ycoOLfP\r\ncfH/rP8RkOP4B/0vp/SFyMjQxlguFya/iqE=\r\n=C2mM\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"davidwells","email":"davidgregorywells@gmail.com"},"directories":{},"maintainers":[{"name":"davidwells","email":"davidgregorywells@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/custify_0.0.1_1667971916883_0.13639776499930112"},"_hasShrinkwrap":false},"0.0.2":{"name":"@analytics/custify","version":"0.0.2","description":"Custify integration for 'analytics' module for browser & node","projectMeta":{"provider":{"name":"Custify","url":"https://www.custify.com/"},"platforms":{"browser":"./src/browser.js","node":"./src/node.js"}},"keywords":["analytics","analytics-project","analytics-plugin","custify"],"author":{"name":"Abisoye Atolagbe","email":"atolagbeabisoye@gmail.com"},"license":"MIT","scripts":{"docs":"node ../analytics-cli/bin/run docs","build":"node ../../scripts/build/index.js","watch":"node ../../scripts/build/_watch.js","release:patch":"npm version patch && npm publish","release:minor":"npm version minor && npm publish","release:major":"npm version major && npm publish","es":"../../node_modules/.bin/babel-node ./testBabel.js"},"main":"lib/analytics-plugin-custify.cjs.js","globalName":"analyticsCustify","jsnext:main":"lib/analytics-plugin-custify.es.js","module":"lib/analytics-plugin-custify.es.js","browser":{"./lib/analytics-plugin-custify.cjs.js":"./lib/analytics-plugin-custify.browser.cjs.js","./lib/analytics-plugin-custify.es.js":"./lib/analytics-plugin-custify.browser.es.js"},"homepage":"https://github.com/DavidWells/analytics#readme","repository":{"type":"git","url":"git+https://github.com/DavidWells/analytics.git"},"devDependencies":{"@babel/core":"^7.2.2","@babel/preset-env":"^7.3.1"},"dependencies":{"unfetch":"^4.2.0"},"gitHead":"8151c6195808ab69f2fecd54a6878b961947bd71","bugs":{"url":"https://github.com/DavidWells/analytics/issues"},"_id":"@analytics/custify@0.0.2","_nodeVersion":"16.15.1","_npmVersion":"lerna/3.22.1/node@v16.15.1+arm64 (darwin)","dist":{"integrity":"sha512-BhIFyoF1dKf9mn5OZ7xhV5Lmpn7vl8gIfpTsoVy3PUCC9PQFcBi9J0OCMNvQ0F9o8H1tuGfDJMj/UXEtBYtcTg==","shasum":"45421c9fa2d2dd9af3f7641d6ba9c2645d45d608","tarball":"https://registry.npmjs.org/@analytics/custify/-/custify-0.0.2.tgz","fileCount":10,"unpackedSize":43099,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAfhHaEF9BKFVKxbcBt0xsvHvOgHhbM2ryxA9HAY92VKAiA1QReNWqA/fXhnHDT7Ep36YlV0r+kKYSKYv2uuX4DoFw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjazxpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq64A//Y38cPx/dNhDhlWebeXeRZhsf7+M21iLDvPMmP2K1PSzmw9wg\r\nFbiGWAQj7vYbHsfB1EV1lbxz9OvqCkVroCiUqzopGjA4XlywrAzmGZWOkqkX\r\n4KrDsBJQUyS/B/U/Ax574UzFA9+7caMCSg9iTFjyCd0R3n4iuqJSTmAJasyn\r\nHDHWPn2Tl34fzHAU9wBPc6ysjmZqfJI7NNBK5iRN4+LXp+5IlvZLo2+d2Kep\r\nhrLGf0o+208zuzjRcEYCZcMLc/KtXCwgNrPr3kMhilIfHAXbbCgcutFTFoG/\r\nKwIkpUz/zAL1Q8fCPSIxJcJuANnVBJBSkzU4cj3mpy0iiLJcoL8uWgwaNCLx\r\nYKRUc806kB/w8PhxPIUn5rlG3C8Saxo3ofZA9OS7uiLVyo8BHZSstufLgOUe\r\nZIoLdpwQz+Ttm9+M7CArrKd6lzxwOgVgvG0ztQ6cdnpnoY8oXEtX+XPck6lk\r\nMsaTqWqkG0JuDnJelaYHHqZLJkv7jWOANXNTWOb5oWFSJXTlSbb23erU/2VU\r\n1Pqsw0Itz65JD+Wc4z8QLjw0sizlIdbDZbBNg/Rkicf7q6hhZ1DbKH92peCy\r\nv0ghIeRNhwgQ8M5O6fABzREWaQekUyIuXhkb4bxpvfj2bpHog7ZEoARcX1gU\r\nPPX/IooCIw9BfsPE2wBCPzu/k3QtIimIcyw=\r\n=naKT\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"davidwells","email":"davidgregorywells@gmail.com"},"directories":{},"maintainers":[{"name":"davidwells","email":"davidgregorywells@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/custify_0.0.2_1667972201700_0.2392597427999712"},"_hasShrinkwrap":false}},"time":{"created":"2022-11-09T05:31:56.777Z","0.0.1":"2022-11-09T05:31:57.060Z","modified":"2022-11-09T05:36:41.936Z","0.0.2":"2022-11-09T05:36:41.829Z"},"maintainers":[{"name":"davidwells","email":"davidgregorywells@gmail.com"}],"description":"Custify integration for 'analytics' module for browser & node","homepage":"https://github.com/DavidWells/analytics#readme","keywords":["analytics","analytics-project","analytics-plugin","custify"],"repository":{"type":"git","url":"git+https://github.com/DavidWells/analytics.git"},"author":{"name":"Abisoye Atolagbe","email":"atolagbeabisoye@gmail.com"},"bugs":{"url":"https://github.com/DavidWells/analytics/issues"},"license":"MIT","readme":"<!--\ntitle: Custify\ndescription: Using the Custify analytics plugin\n-->\n# Custify plugin for `analytics`\n\nIntegration with Custify for [analytics](https://www.npmjs.com/package/analytics)\n\nThis analytics plugin will load Custify's client side tracking script into your application and send custom events, page views, and identify visitors inside Custify.\n\n[View the docs](https://getanalytics.io/plugins/custify/)\n\n<!-- AUTO-GENERATED-CONTENT:START (TOC:collapse=true&collapseText=Click to expand) -->\n<details>\n<summary>Click to expand</summary>\n\n- [Installation](#installation)\n- [How to use](#how-to-use)\n- [Platforms Supported](#platforms-supported)\n- [Browser usage](#browser-usage)\n  - [Browser API](#browser-api)\n  - [Configuration options for browser](#configuration-options-for-browser)\n- [Server-side usage](#server-side-usage)\n  - [Server-side API](#server-side-api)\n  - [Configuration options for server-side](#configuration-options-for-server-side)\n- [Additional examples](#additional-examples)\n\n</details>\n<!-- AUTO-GENERATED-CONTENT:END (TOC) -->\n\n## Installation\n\nInstall `analytics` and `@analytics/custify` packages\n\n```bash\nnpm install analytics\nnpm install @analytics/custify\n```\n\n<!-- AUTO-GENERATED-CONTENT:START (PLUGIN_DOCS) -->\n\n## How to use\n\nThe `@analytics/custify` package works in [the browser](#browser-usage) and [server-side in Node.js](#server-side-usage). To use, install the package, include in your project and initialize the plugin with [analytics](https://www.npmjs.com/package/analytics).\n\nBelow is an example of how to use the browser plugin.\n\n```js\nimport Analytics from 'analytics'\nimport custifyPlugin from '@analytics/custify'\n\nconst analytics = Analytics({\n  app: 'awesome-app',\n  plugins: [\n    // This will load crazy egg on to the page\n    custifyPlugin({\n      accountId: '1234578'\n    })\n  ]\n})\n\n/* Track a page view */\nanalytics.page()\n\n/* Track a custom event */\nanalytics.track('cartCheckout', {\n  item: 'pink socks',\n  price: 20\n})\n\n/* Identify a visitor */\nanalytics.identify('user-id-xyz', {\n  firstName: 'bill',\n  lastName: 'murray'\n})\n\n```\n\nAfter initializing `analytics` with the `custifyPlugin` plugin, data will be sent into Custify whenever [analytics.page](https://getanalytics.io/api/#analyticspage), [analytics.track](https://getanalytics.io/api/#analyticstrack), or [analytics.identify](https://getanalytics.io/api/#analyticsidentify) are called.\n\nSee [additional implementation examples](#additional-examples) for more details on using in your project.\n\n## Platforms Supported\n\nThe `@analytics/custify` package works in [the browser](#browser-usage) and [server-side in Node.js](#server-side-usage)\n\n## Browser usage\n\nThe Custify client side browser plugin works with these analytic api methods:\n\n- **[analytics.identify](https://getanalytics.io/api/#analyticsidentify)** - Identify visitors and send details to Custify\n- **[analytics.page](https://getanalytics.io/api/#analyticspage)** - Sends page views into Custify\n- **[analytics.track](https://getanalytics.io/api/#analyticstrack)** - Track custom events and send to Custify\n\n### Browser API\n\n```js\nimport Analytics from 'analytics'\nimport custifyPlugin from '@analytics/custify'\n\nconst analytics = Analytics({\n  app: 'awesome-app',\n  plugins: [\n    // This will load crazy egg on to the page\n    custifyPlugin({\n      accountId: '1234578'\n    })\n  ]\n})\n\n```\n\n### Configuration options for browser\n\n| Option | description |\n|:---------------------------|:-----------|\n| `accountId` <br/>**required** - string| custify account ID |\n| `scriptInclude` <br/>_optional_ - boolean| Load custify script into page |\n| `options` <br/>_optional_ - object| Custify script options |\n\n## Server-side usage\n\nThe Custify server-side node.js plugin works with these analytic api methods:\n\n- **[analytics.page](https://getanalytics.io/api/#analyticspage)** - Sends page views into Custify\n- **[analytics.track](https://getanalytics.io/api/#analyticstrack)** - Track custom events and send to Custify\n- **[analytics.identify](https://getanalytics.io/api/#analyticsidentify)** - Identify visitors and send details to Custify\n\n### Server-side API\n\n```js\nimport Analytics from 'analytics'\nimport custifyPlugin from '@analytics/custify'\n\nconst analytics = Analytics({\n  app: 'awesome-app',\n  plugins: [\n    custifyPlugin({\n      apiKey: 'abc123'\n    })\n  ]\n})\n\n```\n\n### Configuration options for server-side\n\n| Option | description |\n|:---------------------------|:-----------|\n| `apiKey` <br/>**required** - string| custify API key |\n\n\n## Additional examples\n\nBelow are additional implementation examples.\n\n<details>\n  <summary>Server-side ES6</summary>\n\n  ```js\n  import Analytics from 'analytics'\n  import custifyPlugin from '@analytics/custify'\n\n  const analytics = Analytics({\n    app: 'awesome-app',\n    plugins: [\n      custifyPlugin({\n        apiKey: 'abc123'\n      })\n      // ...other plugins\n    ]\n  })\n\n  /* Track a page view */\n  analytics.page()\n\n  /* Track a custom event */\n  analytics.track('cartCheckout', {\n    item: 'pink socks',\n    price: 20\n  })\n\n  /* Identify a visitor */\n  analytics.identify('user-id-xyz', {\n    firstName: 'bill',\n    lastName: 'murray'\n  })\n\n  ```\n\n</details>\n\n<details>\n  <summary>Server-side Node.js with common JS</summary>\n\n  If using node, you will want to import the `.default`\n\n  ```js\n  const analyticsLib = require('analytics').default\n  const custifyPlugin = require('@analytics/custify').default\n\n  const analytics = analyticsLib({\n    app: 'my-app-name',\n    plugins: [\n      custifyPlugin({\n        apiKey: 'abc123'\n      })\n    ]\n  })\n\n  /* Track a page view */\n  analytics.page()\n\n  /* Track a custom event */\n  analytics.track('cartCheckout', {\n    item: 'pink socks',\n    price: 20\n  })\n\n  /* Identify a visitor */\n  analytics.identify('user-id-xyz', {\n    firstName: 'bill',\n    lastName: 'murray'\n  })\n\n  ```\n\n</details>\n\n<details>\n  <summary>Using in HTML</summary>\n\n  Below is an example of importing via the unpkg CDN. Please note this will pull in the latest version of the package.\n\n  ```html\n  <!DOCTYPE html>\n  <html>\n    <head>\n      <title>Using @analytics/custify in HTML</title>\n      <script src=\"https://unpkg.com/analytics/dist/analytics.min.js\"></script>\n      <script src=\"https://unpkg.com/@analytics/custify/dist/@analytics/custify.min.js\"></script>\n      <script type=\"text/javascript\">\n        /* Initialize analytics */\n        var Analytics = _analytics.init({\n          app: 'my-app-name',\n          plugins: [\n            // This will load crazy egg on to the page\n            analyticsCustify({\n              accountId: '1234578'\n            })\n          ]\n        })\n\n        /* Track a page view */\n        analytics.page()\n\n        /* Track a custom event */\n        analytics.track('cartCheckout', {\n          item: 'pink socks',\n          price: 20\n        })\n\n        /* Identify a visitor */\n        analytics.identify('user-id-xyz', {\n          firstName: 'bill',\n          lastName: 'murray'\n        })\n      </script>\n    </head>\n    <body>\n      ....\n    </body>\n  </html>\n\n  ```\n\n</details>\n\n<details>\n  <summary>Using in HTML via ES Modules</summary>\n\n  Using `@analytics/custify` in ESM modules.\n\n  ```html\n  <!DOCTYPE html>\n  <html>\n    <head>\n      <title>Using @analytics/custify in HTML via ESModules</title>\n      <script>\n        // Polyfill process.\n        // **Note**: Because `import`s are hoisted, we need a separate, prior <script> block.\n        window.process = window.process || { env: { NODE_ENV: 'production' } }\n      </script>\n      <script type=\"module\">\n        import analytics from 'https://unpkg.com/analytics/lib/analytics.browser.es.js?module'\n        import analyticsCustify from 'https://unpkg.com/@analytics/custify/lib/analytics-plugin-custify.browser.es.js?module'\n        /* Initialize analytics */\n        const Analytics = analytics({\n          app: 'analytics-html-demo',\n          debug: true,\n          plugins: [\n            // This will load crazy egg on to the page\n            analyticsCustify({\n              accountId: '1234578'\n            })\n            // ... add any other third party analytics plugins\n          ]\n        })\n\n        /* Track a page view */\n        analytics.page()\n\n        /* Track a custom event */\n        analytics.track('cartCheckout', {\n          item: 'pink socks',\n          price: 20\n        })\n\n        /* Identify a visitor */\n        analytics.identify('user-id-xyz', {\n          firstName: 'bill',\n          lastName: 'murray'\n        })\n      </script>\n    </head>\n    <body>\n      ....\n    </body>\n  </html>\n\n  ```\n\n</details>\n\n\n<!-- AUTO-GENERATED-CONTENT:END (PLUGIN_DOCS) -->\n","readmeFilename":"README.md"}