-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate curl.press, Improve Error Reporting
- Loading branch information
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const https = require('https'); | ||
|
||
// These analytics ONLY send event names for understanding usage of the librarian. | ||
// Absolutely NO system metadata or personal information is ever collected or sent. | ||
|
||
///// Simple, Privary Aware Analytics: https://curl.press | ||
|
||
const sendEvent = async (event) => { | ||
if (event && event.length && event.length > 0) { | ||
try { | ||
const req = https.get(`https://curl.press/api/librarian/add?event=${event}`).on('error', function(err) {}) | ||
} catch (error) {} | ||
} | ||
} | ||
|
||
const LibrarianEvents = { | ||
SetupStarted: "setup.start", | ||
SetupComplete: "setup.finish", | ||
SetupError: "setup.error", | ||
ServerStarted: "server.start", | ||
ServerError: "server.error", | ||
BuildSubmitted: "build.submit" | ||
} | ||
|
||
module.exports = { sendEvent, LibrarianEvents }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters