Skip to content

feat(node): Add @sentry/node-native package #16722

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

Merged
merged 2 commits into from
Jun 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ body:
- '@sentry/node - koa'
- '@sentry/node - hapi'
- '@sentry/node - connect'
- '@sentry/node-native'
- '@sentry/angular'
- '@sentry/astro'
- '@sentry/aws-serverless'
Expand Down
6 changes: 6 additions & 0 deletions dev-packages/e2e-tests/verdaccio-config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ packages:
unpublish: $all
# proxy: npmjs # Don't proxy for E2E tests!

'@sentry/node-native':
access: $all
publish: $all
unpublish: $all
# proxy: npmjs # Don't proxy for E2E tests!

'@sentry/opentelemetry':
access: $all
publish: $all
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"packages/nestjs",
"packages/nextjs",
"packages/node",
"packages/node-native",
"packages/nuxt",
"packages/opentelemetry",
"packages/pino-transport",
Expand Down
11 changes: 11 additions & 0 deletions packages/node-native/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
env: {
node: true,
},
extends: ['../../.eslintrc.js'],

ignorePatterns: ['build/**/*', 'examples/**/*', 'vitest.config.ts'],
rules: {
'@sentry-internal/sdk/no-class-field-initializers': 'off',
},
};
21 changes: 21 additions & 0 deletions packages/node-native/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 Functional Software, Inc. dba Sentry

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
21 changes: 21 additions & 0 deletions packages/node-native/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<p align="center">
<a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
<img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
</a>
</p>

# Native Tools for the Official Sentry Node.js SDK

[![npm version](https://img.shields.io/npm/v/@sentry/node-native.svg)](https://www.npmjs.com/package/@sentry/node-native)
[![npm dm](https://img.shields.io/npm/dm/@sentry/node-native.svg)](https://www.npmjs.com/package/@sentry/node-native)
[![npm dt](https://img.shields.io/npm/dt/@sentry/node-native.svg)](https://www.npmjs.com/package/@sentry/node-native)

## Installation

```bash
# Using yarn
yarn add @sentry/node @sentry/node-native

# Using npm
npm install --save @sentry/node @sentry/node-native
```
78 changes: 78 additions & 0 deletions packages/node-native/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"name": "@sentry/node-native",
"version": "9.27.0",
"description": "Native Tools for the Official Sentry Node.js SDK",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/node-native",
"author": "Sentry",
"license": "MIT",
"main": "build/cjs/index.js",
"module": "build/esm/index.js",
"types": "build/types/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./build/types/index.d.ts",
"default": "./build/esm/index.js"
},
"require": {
"types": "./build/types/index.d.ts",
"default": "./build/cjs/index.js"
}
}
},
"typesVersions": {
"<5.0": {
"build/types/index.d.ts": [
"build/types-ts3.8/index.d.ts"
]
}
},
"engines": {
"node": ">=18"
},
"publishConfig": {
"access": "public"
},
"files": [
"/build",
"package.json"
],
"scripts": {
"clean": "rm -rf build",
"lint": "eslint . --format stylish",
"lint:es-compatibility": "es-check es2022 ./build/cjs/*.js && es-check es2022 ./build/esm/*.js --module",
"fix": "eslint . --format stylish --fix",
"build": "yarn build:types && yarn build:transpile",
"build:transpile": "yarn rollup -c rollup.npm.config.mjs",
"build:types:downlevel": "yarn downlevel-dts build/types build/types-ts3.8 --to ts3.8",
"build:types": "tsc -p tsconfig.types.json && yarn build:types:downlevel",
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:dev": "yarn clean && yarn build",
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
"build:watch": "run-p build:transpile:watch build:types:watch",
"build:tarball": "npm pack"
},
"dependencies": {
"@sentry/core": "9.31.0",
"@sentry/node": "9.31.0"
},
"devDependencies": {
"@types/node": "^18.19.1"
},
"volta": {
"extends": "../../package.json"
},
"sideEffects": false,
"nx": {
"targets": {
"build:transpile": {
"dependsOn": [
"^build:transpile",
"^build:types"
]
}
}
}
}
15 changes: 15 additions & 0 deletions packages/node-native/rollup.npm.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollup-utils';

export default makeNPMConfigVariants(
makeBaseNPMConfig({
entrypoints: ['src/index.ts'],
packageSpecificConfig: {
output: {
dir: 'build',
// set exports to 'named' or 'auto' so that rollup doesn't warn
exports: 'named',
preserveModules: true,
},
},
}),
);
1 change: 1 addition & 0 deletions packages/node-native/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
10 changes: 10 additions & 0 deletions packages/node-native/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "esnext",
"lib": ["es2018"],
"outDir": "build",
"types": ["node"]
},
"include": ["src/**/*"]
}
12 changes: 12 additions & 0 deletions packages/node-native/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "./tsconfig.json",

"include": ["test/**/*", "src/**/*.d.ts", "vite.config.ts"],

"compilerOptions": {
// should include all types from `./tsconfig.json` plus types for all test frameworks used
"types": ["node"]

// other package-specific, test-specific options
}
}
11 changes: 11 additions & 0 deletions packages/node-native/tsconfig.types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"outDir": "build/types",
"types": ["node"]
},
"files": ["src/index.ts"]
}
8 changes: 8 additions & 0 deletions packages/node-native/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import baseConfig from '../../vite/vite.config';

export default {
...baseConfig,
test: {
...baseConfig.test,
},
};
Loading