Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Node] Add warnings to all SDK example apps that would check if propper credentials have been set or it still has the defaults. #90

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
11 changes: 9 additions & 2 deletions examples/apm_example.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
//since we need to test crashing the app
/*global app*/
const COUNTLY_SERVER_KEY = "https://your.server.ly";
const COUNTLY_APP_KEY = "YOUR_APP_KEY";

if(COUNTLY_APP_KEY === "YOUR_APP_KEY" || COUNTLY_SERVER_KEY === "https://your.server.ly"){
throw new Error("Please do not use default set of app key and server url")
}

var Countly = require("../lib/countly.js");

Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly", //your server goes here
app_key: COUNTLY_APP_KEY,
url: COUNTLY_SERVER_KEY, //your server goes here
debug: true
});

Expand Down
11 changes: 9 additions & 2 deletions examples/bulk_import_example.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
const COUNTLY_SERVER_KEY = "https://your.server.ly";
const COUNTLY_APP_KEY = "YOUR_APP_KEY";

if(COUNTLY_APP_KEY === "YOUR_APP_KEY" || COUNTLY_SERVER_KEY === "https://your.server.ly"){
throw new Error("Please do not use default set of app key and server url")
}

var CountlyBulk = require("../lib/countly").Bulk;

var server = new CountlyBulk({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly", //your server goes here
app_key: COUNTLY_APP_KEY,
url: COUNTLY_SERVER_KEY, //your server goes here
debug: true
});

Expand Down
12 changes: 9 additions & 3 deletions examples/example.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
//since we need to test crashing the app
/*global runthis, crashDaApp*/
const COUNTLY_SERVER_KEY = "https://your.server.ly";
const COUNTLY_APP_KEY = "YOUR_APP_KEY";

if(COUNTLY_APP_KEY === "YOUR_APP_KEY" || COUNTLY_SERVER_KEY === "https://your.server.ly"){
throw new Error("Please do not use default set of app key and server url")
}

var Countly = require("../lib/countly.js");

Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly", //your server goes here
app_key: COUNTLY_APP_KEY,
url: COUNTLY_SERVER_KEY, //your server goes here
debug: true
});


Countly.begin_session();

Countly.track_errors();
Expand Down
11 changes: 9 additions & 2 deletions examples/multi-process.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@ else if (cluster.isWorker) {
console.log("I am worker " + cluster.worker.id);
}

const COUNTLY_SERVER_KEY = "https://your.server.ly";
const COUNTLY_APP_KEY = "YOUR_APP_KEY";

if(COUNTLY_APP_KEY === "YOUR_APP_KEY" || COUNTLY_SERVER_KEY === "https://your.server.ly"){
throw new Error("Please do not use default set of app key and server url")
}

var Countly = require("../lib/countly.js");

Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly", //your server goes here
app_key: COUNTLY_APP_KEY,
url: COUNTLY_SERVER_KEY, //your server goes here
debug: true
});

Expand Down
Loading