open-index/open-npm huggingface dataset:
npm package: @get-base/nuxt-segment
Description: Nuxt.js module for Segment Analytics.js
Latest version: 0.3.3

# nuxt-segment

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![Dependencies][david-dm-src]][david-dm-href]
[![Standard JS][standard-js-src]][standard-js-href]

> Nuxt.js module for Segment Analytics

This module uses [vue-segment](https://github.com/dansmaculotte/vue-segment) to add Segment Analytics to a Nuxt.js app.

[📖 **Release Notes**](./CHANGELOG.md)

## Setup

- Add `@dansmaculotte/nuxt-segment` dependency using yarn or npm to your project
- Add `@dansmaculotte/nuxt-segment` to `modules` section of `nuxt.config.js`
3. Configure it:

```js
{
  modules: [
    // Simple usage
    '@dansmaculotte/nuxt-segment',

    // With options
    [
      '@dansmaculotte/nuxt-segment',
      { /* module options */ }
    ],
  ],

  // Or with global options
  segment: {
    writeKey: '',
    disabled: false,
    useRouter: true
  }
}
```

## Options

### writeKey

- Type: `String`
  - Default: `process.env.SEGMENT_WRITE_KEY || ''`

### disabled

- Type: `Boolean`
  - Default: `process.env.SEGMENT_DISABLED || false`

### useRouter

- Type: `Boolean`
  - Default: `process.env.SEGMENT_USE_ROUTER || true`

## Usage

Inside a Vue component, the Segment `analytics` object is available as `this.$segment`:

```js
export default {
  mounted () {
    this.$segment.identify('f4ca124298', {
      name: 'Michael Bolton',
      email: 'mbolton@initech.com'
    });
    this.$segment.track('Signed Up', { plan: 'Enterprise' });
    this.$segment.page('Pricing');
  }
}
```

`$segment` is also injected into the [Nuxt context](https://nuxtjs.org/api/context/) so you can access it within your Vuex stores:

```js
export default {
  LOGOUT({ dispatch }) {
    return this.$auth.logout()
      .then(() => {
        this.$segment.reset();
        return dispatch('AFTER_LOGOUT');
      })
  }
}
```


## Development

- Clone this repository
- Install dependencies using `yarn install`
- Start development server using `npm run dev`

## License

[MIT License](./LICENSE.md)

<!-- Badges -->
[npm-downloads-src]: https://img.shields.io/npm/dt/@dansmaculotte/nuxt-segment.svg?style=flat-square
[npm-downloads-href]: https://npmjs.com/package/@dansmaculotte/nuxt-segment

[npm-version-src]: https://img.shields.io/npm/v/@dansmaculotte/nuxt-segment/latest.svg?style=flat-square
[npm-version-href]: https://npmjs.com/package/@dansmaculotte/nuxt-segment

[david-dm-src]: https://david-dm.org/dansmaculotte/nuxt-segment/status.svg?style=flat-square
[david-dm-href]: https://david-dm.org/dansmaculotte/nuxt-segment

[standard-js-src]: https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square
[standard-js-href]: https://standardjs.com
npm package: @get-base/vue-segment
Description: Vue.js plugin for Segment Analytics.js
Latest version: 0.3.5

# NOT MAINTAINED ANYMORE!

We don't use segment anymore for our website, I don't have an account on Segment to make this plugin evolve.

Please fill in an issue if you want to be a maintainer or if you want redirect people to you fork.

# vue-segment

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![Dependencies][david-dm-src]][david-dm-href]
[![Standard JS][standard-js-src]][standard-js-href]

> Vue.js plugin for Segment Analytics.js

[Segment Analytics.js Documentation](https://segment.com/docs/sources/website/analytics.js/)

## Setup

1. Add the `@dansmaculotte/vue-segment` dependency with `yarn` or `npm` to your project
2. Configure it:

```js
import Vue from 'vue'
import Segment from '@dansmaculotte/vue-segment'

Vue.use(Segment, {
  writeKey: 'YOUR_SEGMENT_WRITE_KEY',
  disabled: true,
  router,
  pageCategory: 'shop',
  settings: {
    ...
  }
})
```

## Usage

See [Segment Vue Quickstart Guide](https://github.com/segmentio/analytics-vue#how-to-get-started).

## Options

### writeKey

- Type: `String`
  - Default: `''`

### disabled

Disable automatic script loading, if you need compliance with GDPR.

- Type: `Boolean`
  - Default: `false`

### router

Call `analytics.page` method on `afterEach` router method if provided.

- Type: `Object`

### pageCategory

In case you provided router, you can specify the category page of the `page` event. See segment [page](https://segment.com/docs/sources/website/analytics.js/#page) method reference.

- Type: `String`,
  - Default: `''`

### settings

See [Load options](https://segment.com/docs/sources/website/analytics.js/#load-options) reference.

- Type: `Object`

## Development

1. Clone this repository
2. Install dependencies using `yarn install` or `npm install`
3. Start development server using `npm run dev`

## License

[MIT License](./LICENSE.md)

<!-- Badges -->

[npm-downloads-src]: https://img.shields.io/npm/dt/@dansmaculotte/vue-segment.svg?style=flat-square
[npm-downloads-href]: https://npmjs.com/package/@dansmaculotte/vue-segment

[npm-version-src]: https://img.shields.io/npm/v/@dansmaculotte/vue-segment/latest.svg?style=flat-square
[npm-version-href]: https://npmjs.com/package/@dansmaculotte/vue-segment

[david-dm-src]: https://david-dm.org/dansmaculotte/vue-segment/status.svg?style=flat-square
[david-dm-href]: https://david-dm.org/dansmaculotte/vue-segment

[standard-js-src]: https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square
[standard-js-href]: https://standardjs.com
npm package: @get-catch/catchjs
Description: A client-side loader for the Catch.js SDK
Author: Catch
Latest version: 1.1.0

# Catch.js ES Module

This package provides an ES module for loading <a href="https://catch.readme.io/reference/catchjs">Catch.js</a> asynchronously, as an alternative to the basic method of including a script tag directly in your HTML (which blocks page rendering).

## Installation

Install the package using `npm` (or `yarn`, or similar):

```sh
npm install @get-catch/catchjs
```

## Usage

Use the `loadCatchjs(options)` function to load Catch.js asynchronously:

```js
import { loadCatchjs } from "@get-catch/catchjs";

const catchjs = await loadCatchjs();
```

Catch.js may be loaded in either "sandbox" mode (intended for dev/test environments) or "live" mode (for production). By default, `loadCatchjs()` will load the sandbox mode. For live mode, pass an `options` argument to `loadCatchjs()` with the entry `live: true`:

```js
const catchjs = await loadCatchjs({
  live: true, // true for "live" mode, false for "sandbox" mode
});
```

`loadCatchjs()` returns a `Promise` that resolves with the `catchjs` namespace object once Catch.js has loaded, and rejects if Catch.js fails to load. This function should only be invoked in a browser or browser-like environment (i.e. when `window` is defined), and will reject if invoked in a server environment.

Once loaded, Catch.js must still be initialized by calling `catchjs.init()` (please refer to the [initialization docs](https://catch.readme.io/reference/catchjs#initialization)).

## TypeScript Support

This package ships with TypeScript declarations for the loading utility, as well as the Catch.js SDK itself.