Skip to content

Commit 895dedd

Browse files
committed
Deno SDK
1 parent 4236181 commit 895dedd

23 files changed

+10846
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"packages/browser-integration-tests",
4646
"packages/bun",
4747
"packages/core",
48+
"packages/deno",
4849
"packages/e2e-tests",
4950
"packages/ember",
5051
"packages/eslint-config-sdk",

packages/deno/.eslintrc.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
env: {
3+
node: true,
4+
},
5+
extends: ['../../.eslintrc.js'],
6+
ignorePatterns: ['lib.deno.d.ts'],
7+
rules: {
8+
'@sentry-internal/sdk/no-optional-chaining': 'off',
9+
'@sentry-internal/sdk/no-nullish-coalescing': 'off',
10+
'@sentry-internal/sdk/no-unsupported-es6-methods': 'off',
11+
'@sentry-internal/sdk/no-class-field-initializers': 'off',
12+
},
13+
};

packages/deno/LICENSE

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Copyright (c) 2023 Sentry (https://sentry.io) and individual contributors. All rights reserved.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
4+
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
5+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
6+
persons to whom the Software is furnished to do so, subject to the following conditions:
7+
8+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
9+
Software.
10+
11+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
13+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
14+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

packages/deno/README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<p align="center">
2+
<a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
3+
<img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
4+
</a>
5+
</p>
6+
7+
# Official Sentry SDK for Deno (Beta)
8+
9+
[![npm version](https://img.shields.io/npm/v/@sentry/deno.svg)](https://www.npmjs.com/package/@sentry/deno)
10+
[![npm dm](https://img.shields.io/npm/dm/@sentry/deno.svg)](https://www.npmjs.com/package/@sentry/deno)
11+
[![npm dt](https://img.shields.io/npm/dt/@sentry/deno.svg)](https://www.npmjs.com/package/@sentry/deno)
12+
13+
## Links
14+
15+
- [Official SDK Docs](https://docs.sentry.io/quickstart/)
16+
- [TypeDoc](http://getsentry.github.io/sentry-javascript/)
17+
18+
The Sentry Deno SDK is in beta. Please help us improve the SDK by [reporting any issues or giving us feedback](https://github.com/getsentry/sentry-javascript/issues).
19+
20+
## Usage
21+
22+
To use this SDK, call `init(options)` as early as possible in the main entry module. This will initialize the SDK and
23+
hook into the environment. Note that you can turn off almost all side effects using the respective options.
24+
25+
```javascript
26+
import * as Sentry from 'npm:@sentry/deno';
27+
28+
Sentry.init({
29+
dsn: '__DSN__',
30+
// ...
31+
});
32+
```
33+
34+
To set context information or send manual events, use the exported functions of `@sentry/deno`. Note that these
35+
functions will not perform any action before you have called `init()`:
36+
37+
```javascript
38+
// Set user information, as well as tags and further extras
39+
Sentry.configureScope(scope => {
40+
scope.setExtra('battery', 0.7);
41+
scope.setTag('user_mode', 'admin');
42+
scope.setUser({ id: '4711' });
43+
// scope.clear();
44+
});
45+
46+
// Add a breadcrumb for future events
47+
Sentry.addBreadcrumb({
48+
message: 'My Breadcrumb',
49+
// ...
50+
});
51+
52+
// Capture exceptions, messages or manual events
53+
Sentry.captureMessage('Hello, world!');
54+
Sentry.captureException(new Error('Good bye'));
55+
Sentry.captureEvent({
56+
message: 'Manual',
57+
stacktrace: [
58+
// ...
59+
],
60+
});
61+
```
62+
63+
64+

packages/deno/jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('../../jest/jest.config.js');

0 commit comments

Comments
 (0)