Socket
Socket
Sign inDemoInstall

@sentry/node

Package Overview
Dependencies
Maintainers
9
Versions
510
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.5.0-beta.1 to 0.5.0-beta.2

dist/backend.d.ts

8

dist/index.d.ts

@@ -1,3 +0,5 @@

export { NodeBackend, NodeOptions } from './lib/backend';
export { NodeFrontend } from './lib/frontend';
export { addBreadcrumb, create, captureEvent, captureException, captureMessage, clearScope, popScope, pushScope, setUserContext, setExtraContext, setTagsContext } from './lib/sdk';
export { Breadcrumb, Context, Request, SdkInfo, SentryEvent, SentryException, Severity, StackFrame, Stacktrace, Thread, User } from '@sentry/shim';
export { addBreadcrumb, captureMessage, captureException, captureEvent, clearScope, popScope, pushScope, setUserContext, setTagsContext, setExtraContext, withScope } from '@sentry/shim';
export { NodeBackend, NodeOptions } from './backend';
export { NodeFrontend } from './frontend';
export { create, getCurrentFrontend } from './sdk';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var backend_1 = require("./lib/backend");
var shim_1 = require("@sentry/shim");
exports.Severity = shim_1.Severity;
var shim_2 = require("@sentry/shim");
exports.addBreadcrumb = shim_2.addBreadcrumb;
exports.captureMessage = shim_2.captureMessage;
exports.captureException = shim_2.captureException;
exports.captureEvent = shim_2.captureEvent;
exports.clearScope = shim_2.clearScope;
exports.popScope = shim_2.popScope;
exports.pushScope = shim_2.pushScope;
exports.setUserContext = shim_2.setUserContext;
exports.setTagsContext = shim_2.setTagsContext;
exports.setExtraContext = shim_2.setExtraContext;
exports.withScope = shim_2.withScope;
var backend_1 = require("./backend");
exports.NodeBackend = backend_1.NodeBackend;
var frontend_1 = require("./lib/frontend");
var frontend_1 = require("./frontend");
exports.NodeFrontend = frontend_1.NodeFrontend;
var sdk_1 = require("./lib/sdk");
exports.addBreadcrumb = sdk_1.addBreadcrumb;
var sdk_1 = require("./sdk");
exports.create = sdk_1.create;
exports.captureEvent = sdk_1.captureEvent;
exports.captureException = sdk_1.captureException;
exports.captureMessage = sdk_1.captureMessage;
exports.clearScope = sdk_1.clearScope;
exports.popScope = sdk_1.popScope;
exports.pushScope = sdk_1.pushScope;
exports.setUserContext = sdk_1.setUserContext;
exports.setExtraContext = sdk_1.setExtraContext;
exports.setTagsContext = sdk_1.setTagsContext;
exports.getCurrentFrontend = sdk_1.getCurrentFrontend;
//# sourceMappingURL=index.js.map
{
"name": "@sentry/node",
"version": "0.5.0-beta.1",
"version": "0.5.0-beta.2",
"description": "Offical Sentry SDK for Node.js",
"repository": "https://github.com/getsentry/raven-js",
"repository": "https://github.com/getsentry/raven-js/tree/next",
"author": "Sentry",

@@ -17,5 +17,4 @@ "license": "BSD-3-Clause",

"dependencies": {
"@sentry/core": "0.5.0-beta.1",
"@sentry/shim": "0.5.0-beta.1",
"@sentry/utils": "0.5.0-beta.1",
"@sentry/core": "0.5.0-beta.2",
"@sentry/shim": "0.5.0-beta.2",
"raven": "^2.4.2"

@@ -22,0 +21,0 @@ },

@@ -8,3 +8,3 @@ <p align="center">

# Official Sentry SDK for NodeJS
# Official Sentry SDK for NodeJS (Preview)

@@ -15,12 +15,18 @@ [![npm version](https://img.shields.io/npm/v/@sentry/node.svg)](https://www.npmjs.com/package/@sentry/node)

**WARNING:** This SDK is part of an early access preview for the
[next generation](https://github.com/getsentry/raven-js/tree/next#readme) of
Sentry JavaScript SDKs. Public interfaces might change and break backwards
compatibility from time to time. We absolutely recommend
[raven](https://github.com/getsentry/raven-node) in production!
## Usage
To use this SDK, call `SentryClient.create(options)` as early as possible in the
main entry module. This will initialize the SDK and hook into the environment.
Note that you can turn off almost all side effects using the respective options.
To use this SDK, call `create(options)` as early as possible in the main entry
module. This will initialize the SDK and hook into the environment. Note that
you can turn off almost all side effects using the respective options.
```javascript
import { SentryClient } from '@sentry/node';
const Sentry = require('@sentry/node');
SentryClient.create({
Sentry.create({
dsn: '__DSN__',

@@ -31,16 +37,14 @@ // ...

To set context information or send manual events, use the provided methods on
`SentryClient`. Note that these functions will not perform any action before you
have called `SentryClient.create()`:
To set context information or send manual events, use the exported functions of
`@sentry/node`. Note that these functions will not perform any action before you
have called `create()`:
```javascript
// Set user information, as well as tags and further extras
SentryClient.setContext({
extra: { battery: 0.7 },
tags: { user_mode: 'admin' },
user: { id: '4711' },
});
Sentry.setExtraContext({ battery: 0.7 });
Sentry.setTagsContext({ user_mode: 'admin' });
Sentry.setUserContext({ id: '4711' });
// Add a breadcrumb for future events
SentryClient.addBreadcrumb({
Sentry.addBreadcrumb({
message: 'My Breadcrumb',

@@ -51,5 +55,5 @@ // ...

// Capture exceptions, messages or manual events
SentryClient.captureMessage('Hello, world!');
SentryClient.captureException(new Error('Good bye'));
SentryClient.captureEvent({
Sentry.captureMessage('Hello, world!');
Sentry.captureException(new Error('Good bye'));
Sentry.captureEvent({
message: 'Manual',

@@ -68,3 +72,3 @@ stacktrace: [

```javascript
import { NodeFrontend } from '@sentry/node';
const { NodeFrontend } = require('@sentry/node');

@@ -79,23 +83,1 @@ const client = new NodeFrontend({

```
Note that `install()` returns a `Promise` that resolves when the installation
has finished. It is not necessary to wait for the installation before adding
breadcrumbs, defining context or sending events. However, the return value
indicates whether the installation was successful and the environment could be
instrumented:
```javascript
import { NodeFrontend } from '@sentry/node';
const client = new NodeFrontend({
dsn: '__DSN__',
// ...
});
const success = await client.install();
if (success) {
// Will capture unhandled promise rejections, etc...
} else {
// Limited instrumentation, but sending events will still work
}
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc