This package has been deprecated

Author message:

This package has been moved to @segment/snippet

segmentio-snippet

3.1.0 • Public • Published

Circle CI

snippet

Render the analytics.js snippet.

Example

var snippet = require('snippet');
 
var contents = snippet.max({
  host: 'cdn.segment.com',
  apiKey: '03fwkuu3',
  page: {
    category: 'Docs',
    name: 'Integrations',
    properties: {
      foo: 'bar'
    }
  }
});

API

snippet.max(options)

Returns the maxified version of the analytics.js snippet given a set of options:

  • host: the domain name where the analytics.js script is hosted
  • apiKey: the apiKey to load in the snippet
  • page: the options to pass to analytics.page. if page is false, then the page() call will be omitted

snippet.min(options)

Returns the minified version of the snippet.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Published

Version History

  • Version
    Downloads (Last 7 Days)
    • Published

Package Sidebar

Install

npm i segmentio-snippet

Weekly Downloads

22

Version

3.1.0

License

none

Last publish

Collaborators

  • segmentio