Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fair-analytics-client-api

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fair-analytics-client-api

The Fair Analytics client API

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Fair Analytics client JavaScript API

The quickest way to integrate Fair Analytics in your app

Travis Code Coverage David npm npm JavaScript Style Guide MIT License gzip size

Install

This project uses node and npm. Go check them out if you don't have them locally installed.

$ yarn add fair-analytics-client-api

Then with a module bundler like rollup or webpack, use as you would anything else:

// using ES6 modules
import fairAnalytics from 'fair-analytics-client-api'

// using CommonJS modules
var fairAnalytics = require('fair-analytics-client-api')

The UMD build is also available on unpkg:

<script src="https://unpkg.com/fair-analytics-client-api/dist/fair-analytics-client-api.umd.js"></script>

You can find the library on window.fairAnalytics.

Usage

import fairAnalytics from 'fair-analytics-client-api'

// create a fa instance
const fa = fairAnalytics({
  url: 'https://fa.yoursite.com' // the URL of your hosted Fair Analytics instance
})

// track events
fa.send({
  event: 'pageView' // event is mandatory and can be anything
})
.then(res => {
  if (res.ok) {
    console.log('success')
  }
})
.catch(err => {
  console.error(err.message)
})

Tests

$ yarn run test

Change Log

This project adheres to Semantic Versioning.
Every release, along with the migration instructions, is documented in the CHANGELOG.md file.

License

MIT

Keywords

FAQs

Package last updated on 05 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc