Skip to content
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
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 @@ -74,6 +74,12 @@ packages:
unpublish: $all
# proxy: npmjs # Don't proxy for E2E tests!

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

'@sentry/ember':
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 @@ -60,6 +60,7 @@
"packages/core",
"packages/cloudflare",
"packages/deno",
"packages/effect",
"packages/ember",
"packages/eslint-config-sdk",
"packages/eslint-plugin-sdk",
Expand Down
15 changes: 15 additions & 0 deletions packages/effect/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
env: {
browser: true,
node: true,
},
overrides: [
{
files: ['vite.config.ts', 'vitest.config.ts'],
parserOptions: {
project: ['tsconfig.vite.json'],
},
},
],
extends: ['../../.eslintrc.js'],
};
21 changes: 21 additions & 0 deletions packages/effect/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 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.
47 changes: 47 additions & 0 deletions packages/effect/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Official Sentry SDK for Effect.ts (Alpha)

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

> NOTICE: This package is in alpha state and may be subject to breaking changes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> NOTICE: This package is in alpha state and may be subject to breaking changes.
> [!IMPORTANT]
> This package is in alpha state and may be subject to breaking changes.

## Getting Started

This SDK does not have docs yet. Stay tuned.

## Usage

```typescript
import * as Sentry from '@sentry/effect/server';
import { NodeRuntime } from '@effect/platform-node';
import { Layer } from 'effect';
import { HttpLive } from './Http.js';

const MainLive = HttpLive.pipe(
Layer.provide(
Sentry.effectLayer({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we export effectLayer? I only see init getting exported 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README already reflects the actual usage, while the export doesn't exist yet, this will come in another PR (also init is exposed here, just for the sake of completeness)

This will be added in later steps.

dsn: '__DSN__',
enableLogs: true,
enableMetrics: true,
}),
),
);

MainLive.pipe(Layer.launch, NodeRuntime.runMain);
```

The `effectLayer` function initializes Sentry and returns an Effect Layer that provides:

- Distributed tracing with automatic HTTP header extraction/injection
- Effect spans traced as Sentry spans
- Effect logs forwarded to Sentry (when `enableLogs` is set)
- Effect metrics sent to Sentry (when `enableMetrics` is set)

## Links

<!-- - [Official SDK Docs](https://docs.sentry.io/platforms/javascript/guides/effect/) -->

- [Sentry.io](https://sentry.io/?utm_source=github&utm_medium=npm_effect)
- [Sentry Discord Server](https://discord.gg/Ww9hbqr)
- [Stack Overflow](https://stackoverflow.com/questions/tagged/sentry)
67 changes: 67 additions & 0 deletions packages/effect/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"name": "@sentry/effect",
"version": "10.42.0",
"description": "Official Sentry SDK for Effect",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/effect",
"author": "Sentry",
"license": "MIT",
"engines": {
"node": ">=18"
},
"files": [
"/build"
],
"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"
]
}
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@sentry/core": "10.42.0"
},
"scripts": {
"build": "run-p build:transpile build:types",
"build:dev": "yarn build",
"build:transpile": "rollup -c rollup.npm.config.mjs",
"build:types": "run-s build:types:core build:types:downlevel",
"build:types:core": "tsc -p tsconfig.types.json",
"build:types:downlevel": "yarn downlevel-dts build/types build/types-ts3.8 --to ts3.8",
"build:watch": "run-p build:transpile:watch",
"build:dev:watch": "yarn build:watch",
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
"build:tarball": "npm pack",
"circularDepCheck": "madge --circular src/index.ts",
"clean": "rimraf build coverage sentry-effect-*.tgz",
"fix": "eslint . --format stylish --fix",
"lint": "eslint . --format stylish",
"test": "vitest run",
"test:watch": "vitest --watch",
"yalc:publish": "yalc publish --push --sig"
},
"volta": {
"extends": "../../package.json"
},
"sideEffects": false
}
11 changes: 11 additions & 0 deletions packages/effect/rollup.npm.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollup-utils';

export default makeNPMConfigVariants(
makeBaseNPMConfig({
packageSpecificConfig: {
output: {
preserveModulesRoot: 'src',
},
},
}),
);
87 changes: 87 additions & 0 deletions packages/effect/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
export type {
Breadcrumb,
BreadcrumbHint,
Context,
Contexts,
RequestEventData,
SdkInfo,
Event,
EventHint,
ErrorEvent,
Exception,
SeverityLevel,
StackFrame,
Stacktrace,
Thread,
User,
Session,
CaptureContext,
ExclusiveEventHintOrCaptureContext,
Log,
LogSeverityLevel,
Span,
} from '@sentry/core';

export {
addEventProcessor,
addBreadcrumb,
addIntegration,
captureException,
captureEvent,
captureFeedback,
captureMessage,
close,
createTransport,
lastEventId,
flush,
getClient,
isInitialized,
isEnabled,
getCurrentScope,
getIsolationScope,
getGlobalScope,
setCurrentClient,
Scope,
continueTrace,
getTraceData,
suppressTracing,
SDK_VERSION,
setContext,
setExtra,
setExtras,
setTag,
setTags,
setUser,
withScope,
withIsolationScope,
functionToStringIntegration,
eventFiltersIntegration,
dedupeIntegration,
parameterize,
startSession,
captureSession,
endSession,
spanToJSON,
spanToTraceHeader,
spanToBaggageHeader,
updateSpanName,
metrics,
getActiveSpan,
getRootSpan,
startSpan,
startInactiveSpan,
startSpanManual,
withActiveSpan,
startNewTrace,
getSpanDescendants,
setMeasurement,
getSpanStatusFromHttpCode,
setHttpStatus,
} from '@sentry/core';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing init export despite PR description claiming inclusion

Medium Severity

The PR description explicitly states "also init is exposed here, just for the sake of completeness" but init is neither defined nor exported anywhere in packages/effect/src/index.ts. Every other SDK package in this repo (nestjs, bun, svelte, react, etc.) defines its own init function that wraps initAndBind from @sentry/core and calls applySdkMetadata. Neither init nor applySdkMetadata exists in this package. A reviewer also flagged the missing applySdkMetadata call.

Fix in Cursor Fix in Web


export {
SEMANTIC_ATTRIBUTE_SENTRY_OP,
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
} from '@sentry/core';
8 changes: 8 additions & 0 deletions packages/effect/test/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { describe, expect, it } from 'vitest';
import * as index from '../src';

describe('effect index export', () => {
it('has correct exports', () => {
expect(index.captureException).toBeDefined();
});
});
8 changes: 8 additions & 0 deletions packages/effect/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "esnext",
"outDir": "build"
},
"include": ["src/**/*"]
}
9 changes: 9 additions & 0 deletions packages/effect/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",

"include": ["test/**/*", "vitest.config.ts"],

"compilerOptions": {
"types": ["node"]
}
}
10 changes: 10 additions & 0 deletions packages/effect/tsconfig.types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"outDir": "build/types"
},
"include": ["src/**/*"]
}
9 changes: 9 additions & 0 deletions packages/effect/tsconfig.vite.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",

"include": ["vite.config.ts", "vitest.config.ts"],

"compilerOptions": {
"types": ["node"]
}
}
10 changes: 10 additions & 0 deletions packages/effect/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from 'vitest/config';
import baseConfig from '../../vite/vite.config';

export default defineConfig({
...baseConfig,
test: {
...baseConfig.test,
include: ['test/**/*.test.ts'],
},
});
Loading