Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
Add alert about node vs raven-js when it seems like a browser env
Browse files Browse the repository at this point in the history
  • Loading branch information
LewisJEllis committed Feb 23, 2017
1 parent de29b93 commit 7bbe9b8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ nodeUtil.inherits(Raven, events.EventEmitter);

extend(Raven.prototype, {
config: function config(dsn, options) {
// We get lots of users using raven-node when they want raven-js, hence this warning if it seems like a browser
if (typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined') {
utils.consoleAlert('seems like a browser environment, are you sure you want the Sentry Node.js SDK? consider raven-js: https://sentry.io/for/javascript');
}

if (arguments.length === 0) {
// no arguments, use default from environment
dsn = process.env.SENTRY_DSN;
Expand Down

0 comments on commit 7bbe9b8

Please sign in to comment.