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

gosquared

Package Overview
Dependencies
Maintainers
3
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gosquared - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

lib/testHelpers.js

6

config.js

@@ -25,13 +25,8 @@ module.exports = {

"aggregateStats",
"alertPreferences",
"campaigns",
"concurrents",
"engagement",
"events",
"expandUrl",
"fullDump",
"functions",
"geo",
"ignoredVisitors",
"notifications",
"organics",

@@ -45,3 +40,2 @@ "overview",

"timeSeries",
"trends",
"visitors"

@@ -48,0 +42,0 @@ ]

6

lib/gosquared.js

@@ -42,7 +42,7 @@ var https = require('https'),

}
this.opts = h.extend(opts, {
this.opts = h.extend({
requestTimeout: 2000,
version: 'latest',
debugLevel: 'FATAL'
});
}, opts);
this.config = config;

@@ -105,3 +105,3 @@ };

var dLevel = this.opts.debugLevel || 'ALL';
if(!debugLevels[dLevel] & debugLevels[level]) return false;
if(!(debugLevels[dLevel] & debugLevels[level])) return false;
var stream = console.log;

@@ -108,0 +108,0 @@ if(level > debugLevels['NOTICE']) stream = console.error;

{
"name": "gosquared",
"version": "0.1.0",
"version": "0.1.1",
"description": "GoSquared for your Node.JS application",

@@ -5,0 +5,0 @@ "main": "lib/gosquared.js",

# node-gosquared
This node module works with the [GoSquared API](https://www.gosquared.com/developer), making it really easy to integrate GoSquared with your node app.
This node module works with the [GoSquared API](api-docs), making it really easy to integrate GoSquared with your node app.
It can be used as an easy proxy so you don't expose your API Key too.
It can be used as an easy proxy for frontend JavaScript so you don't publically expose your API Key.

@@ -11,3 +11,17 @@ ## Installation

```
## Usage
```javascript
var gosquared = new GoSquared(opts);
```
##### Options
* api_key: API key from your [account](casa). Required for API functions, not required for tracking functions.
* site_token: Token for the registered site you're working with. Required.
* requestTimeout: Maximum time in ms an API request can be pending. Default 2000ms
* debugLevel: One of 'TRACE', 'NOTICE', 'WARNING', 'ALL'. Default 'ALL'
### API
```javascript

@@ -25,2 +39,31 @@ var GoSquared = require('gosquared');

});
```
```
All functions listed in the [API documentation](api-docs) are methods you can call on the ```gosquared``` object.
### Tracking
##### Events
Send events to GoSquared:
```javascript
gosquared.storeEvent('Test Event', {its: true, 'you can': 'store', any: 'event', properties: 'You Like' });
```
## Run tests
Install all dependencies using ```npm install``` then:
```bash
make test
```
Optionally, you can run the tests with a site token and API key of your choice:
```bash
SITE_TOKEN=<your token> API_KEY=<your api key> make test
```
[api-docs]: https://www.gosquared.com/developer/latest/
[casa]: https://www.gosquared.com/home/developer
var GoSquared = require('../lib/gosquared'),
should = require('should'),
config = require('../config');
config = require('../config'),
th = require('../lib/testHelpers');
var GS,
SITE_TOKEN = process.env.SITE_TOKEN,
API_KEY = process.env.API_KEY;
SITE_TOKEN = process.env.siteToken,
API_KEY = process.env.apiKey;

@@ -15,3 +16,3 @@ before(function(){

apiKey: API_KEY,
debugLevel: 'ALL'
debugLevel: process.env.verbosity
});

@@ -23,5 +24,5 @@ });

it(fName, function(fName, done){
GS[fName](done);
GS[fName](th.testResponse.bind(this, done));
}.bind(this, fName));
});
});
var GoSquared = require('../lib/gosquared'),
should = require('should');
should = require('should'),
th = require('../lib/testHelpers');
var GS,
SITE_TOKEN = process.env.SITE_TOKEN,
API_KEY = process.env.API_KEY;
SITE_TOKEN = process.env.siteToken,
API_KEY = process.env.apiKey;

@@ -14,3 +15,3 @@ before(function(){

apiKey: API_KEY,
debugLevel: 'ALL'
debugLevel: process.env.verbosity
});

@@ -21,4 +22,4 @@ });

it('can be stored using storeEvent', function(done){
GS.storeEvent('Test Event', done);
GS.storeEvent('Test Event', th.testResponse.bind(this, done));
});
});

Sorry, the diff of this file is not supported yet

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