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

gassian

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gassian

Tiny API wrapper for Atlassian Public Analytics aka GAS

  • 0.6.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Gassian

Greenkeeper badge

Build Status Coverage Status

Installation

npm install gassian
// ES6 modules
import GAS from 'gassian'

// CommonJS modules
const GAS = require('gassian')

Usage

Initialize GAS

const gas = new GAS({
  product: 'bitbucket',
  subproduct: 'addon-template',
  domain: 'prod.atlassian.com'
})
GAS constructor parameters
ParameterRequiredDefaultTypeDescription
apiUrlyesstringRemoved from the library by security reason. You can take URL from GAS documentation (Atlassian internal only). Don't forget to add version to URL
productyesstringProduct name (for add-ons main product name can be passed, e.g. jira or bitbucket)
subproductnostringAdd-on name like addon-template
domainyesstringProduction domain. E.g. prod.atlassian.com
versionnostring'1.2.3'
prefixnofalsebooleanIt adds subproduct name to event name. E.g. addon-template.project-config.visited
hashnotruebooleanUserId and cloudId are hashed by default. Set to false if you need actual user data.
isServerOnProductionyes (server only)booleanWe can detect actual URL in browser with window.location.href. But it's tricky on server-side. That's why we need it on server
loggingnofalsebooleanLogs prepared to send event to console. Remove this parameter in production

Send event/events

const event = {
  cloudId: 'Instance id or URL',
  user: 'User id or name',
  name: 'visited',
  page: 'project-config'
}

// To send one event pass event object to send method
gas.send(event)

// To send multiple events pass array of event objects
gas.send([event1, event2])

// Final event name is:
`project-config.visited`

// If prefix passed to constructor is true
`addon-template.project-config.visited`
Event payload
ParameterRequiredDefaultTypeDescription
nameyesstringEvent dotseparated name. E.g. some-button.clicked
pagenostringE.g. project-config which will included in event name as project-config.some-button.clicked
useryes'-'string or integerUnique user id which will be hashed (for not exposing private data)
cloudIdyesstring or integerCloud id or cloud URL
propertiesnoobjectOne level nested object. Only primitive (int, float, string, bool) values are allowed
hashnoboolean or objectEnable or disabling hashing for one event. Also, it can accept object with cloudId or/and user with boolean to hash one of the values.

Keywords

FAQs

Package last updated on 30 Sep 2020

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