# hbs-analyticsjs-snippet

> Handlebars helper for the analytics.js snippet.

Latest version **0.2.1** (published 2018-09-27) · 0 weekly downloads

## Install

```sh
npm install hbs-analyticsjs-snippet
pnpm add hbs-analyticsjs-snippet
yarn add hbs-analyticsjs-snippet
bun add hbs-analyticsjs-snippet
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2018-09-27 |
| First published | 2013-12-04 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 2.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | ivolo, segment-admin, segmentio |
| Keywords | analytics.js, handlebars, snippet |

## Links

- npm: https://www.npmjs.com/package/hbs-analyticsjs-snippet
- Repository: https://github.com/segmentio/hbs-analyticsjs-snippet
- Homepage: https://github.com/segmentio/hbs-analyticsjs-snippet#readme
- Issues: https://github.com/segmentio/hbs-analyticsjs-snippet/issues
- npm.io page: https://npm.io/package/hbs-analyticsjs-snippet

## Dependencies (2)

- [defaults](https://npm.io/package/defaults.md) ~1.0.0
- [segmentio-snippet](https://npm.io/package/segmentio-snippet.md) 3

## Recent versions

- 0.2.1 (latest) — 2018-09-27
- 0.2.0 — 2014-11-26
- 0.1.0 — 2014-10-15
- 0.0.3 — 2014-04-01
- 0.0.2 — 2013-12-04
- 0.0.1 — 2013-12-04

## README

# hbs-analyticsjs-snippet

  Handlebars helper for the [analytics.js](segmentio/analytics.js) snippet.

## Installation
  
    $ npm install hbs-analyticsjs-snippet

## Example

```js
var snippet = require('hbs-analyticsjs-snippet');
var hbs = require('hbs');

hbs.registerHelper('analyticsjs', snippet('WRITE_KEY'));
```

```html
 <script>
    {{ analyticsjs }}
  </script>
```

## API

### snippet(writeKey, options)
  
  Creates a handlebars helper for the [analytics.js](segmentio/analytics.js) snippet, with a `writeKey` and custom `options`:

```js
{
  min: true, // minified snippet by default
  host: 'cdn.segment.com' // where your analytics.js is hosted
}
```


## License

```
WWWWWW||WWWWWW
 W W W||W W W
      ||
    ( OO )__________
     /  |           \
    /o o|    MIT     \
    \___/||_||__||_|| *
         || ||  || ||
        _||_|| _||_||
       (__|__|(__|__|
```

---
_Source: https://npm.io/package/hbs-analyticsjs-snippet · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
