0.6.1 • Published 4 years ago

gassian v0.6.1

Weekly downloads
50
License
MIT
Repository
github
Last release
4 years ago

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.
0.6.1

4 years ago

0.6.0

6 years ago

0.5.4

6 years ago

0.5.3

6 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.4

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago