Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var Mixpanel = require('./lib/mixpanel-node');

// create an instance of the mixpanel client
var mixpanel = Mixpanel.init('962dbca1bbc54701d402c94d65b4a20e');
mixpanel.set_config({ debug: true });
mixpanel.set_config({ debug: true, strict: true });

// track an event with optional properties
mixpanel.track("my event", {
Expand Down
4 changes: 4 additions & 0 deletions lib/mixpanel-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ var create_client = function(token, config) {
query_params.test = 1;
}

if (metrics.config.strict) {
query_params.strict = 1;
}

request_options.path = metrics.config.path + endpoint + "?" + querystring.stringify(query_params);

request = request_lib.request(request_options, function(res) {
Expand Down
5 changes: 3 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ Quick Start
var Mixpanel = require('mixpanel');

// create an instance of the mixpanel client
var mixpanel = Mixpanel.init('<YOUR_TOKEN>');
var mixpanel = Mixpanel.init('<YOUR_TOKEN>', {strict: true});

// initialize mixpanel client configured to communicate over https
var mixpanel = Mixpanel.init('<YOUR_TOKEN>', {
protocol: 'https'
protocol: 'https',
strict: true,
});

// track an event with optional properties
Expand Down