@domandigital/sentry 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,208 @@
1
+ /**
2
+ * Where environment, release and DSN come from. Every runtime hands its own
3
+ * variables over (`import.meta.env`, `process.env`, a Worker's `env`), because
4
+ * a library cannot read a browser bundle's variables for itself: bundlers only
5
+ * inline the names a consumer writes out literally.
6
+ */
7
+ /** The org every Doman Digital project lives in. */
8
+ declare const SENTRY_ORG = "domandigital";
9
+ /** The org's EU ingest host. DSNs minted before the org transfer still work, but name another org. */
10
+ declare const INGEST_HOST = "o4510784554991616.ingest.de.sentry.io";
11
+ /** The only environments a Doman Digital project reports under. */
12
+ declare const ENVIRONMENTS: readonly ["production", "staging", "preview"];
13
+ type SentryEnvironment = (typeof ENVIRONMENTS)[number];
14
+ /** Anything with string-ish values: `process.env`, `import.meta.env`, a Worker's `env`. */
15
+ type EnvSource = Readonly<Record<string, unknown>> | null | undefined;
16
+ /** Read in this order; the first non-empty value wins. */
17
+ declare const ENVIRONMENT_VARS: readonly ["SENTRY_ENVIRONMENT", "PUBLIC_SENTRY_ENVIRONMENT", "NEXT_PUBLIC_SENTRY_ENVIRONMENT", "VERCEL_ENV", "NEXT_PUBLIC_VERCEL_ENV"];
18
+ declare const RELEASE_VARS: readonly ["SENTRY_RELEASE", "PUBLIC_SENTRY_RELEASE", "NEXT_PUBLIC_SENTRY_RELEASE", "CF_PAGES_COMMIT_SHA", "WORKERS_CI_COMMIT_SHA", "VERCEL_GIT_COMMIT_SHA", "NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA", "GITHUB_SHA"];
19
+ declare const DSN_VARS: readonly ["SENTRY_DSN", "PUBLIC_SENTRY_DSN", "NEXT_PUBLIC_SENTRY_DSN"];
20
+ interface ResolvedEnvironment {
21
+ environment: SentryEnvironment;
22
+ /** False on a developer's machine (`development`, `dev`, `local`, `test`). */
23
+ enabled: boolean;
24
+ /** The variable it came from, `"explicit"`, or null when nothing was set. */
25
+ from: string | null;
26
+ }
27
+ /**
28
+ * `production`, `staging` or `preview`, from one variable. Never hardcode it:
29
+ * a preview deploy that says `production` pages people for nothing.
30
+ *
31
+ * Unset or unrecognised falls back to `preview`, so a forgotten variable shows
32
+ * up as preview noise rather than as a production incident.
33
+ */
34
+ declare function resolveEnvironment(input?: {
35
+ environment?: string | null;
36
+ env?: EnvSource;
37
+ }): ResolvedEnvironment;
38
+ /** The git SHA of the build, from whichever CI built it. Undefined when none is set. */
39
+ declare function resolveRelease(input?: {
40
+ release?: string | null;
41
+ env?: EnvSource;
42
+ }): string | undefined;
43
+ /**
44
+ * Rewrites a DSN that names a pre-transfer org host to {@link INGEST_HOST}.
45
+ * The key and project id are what route an event, so the old hosts work; they
46
+ * only confuse whoever reads the config next. Anything else is returned as is.
47
+ */
48
+ declare function normaliseDsn(dsn: string | null | undefined): string | undefined;
49
+ /** The DSN given, else the first of `SENTRY_DSN`, `PUBLIC_SENTRY_DSN`, `NEXT_PUBLIC_SENTRY_DSN`. */
50
+ declare function resolveDsn(input?: {
51
+ dsn?: string | null;
52
+ env?: EnvSource;
53
+ }): string | undefined;
54
+
55
+ /**
56
+ * The one builder behind every entry point. It returns plain `Sentry.init`
57
+ * options and imports no SDK, so the same code serves `@sentry/browser`,
58
+ * `@sentry/astro`, `@sentry/cloudflare` and `@sentry/nextjs` at whatever
59
+ * version the site has installed: v10 and v11 are both supported.
60
+ *
61
+ * Where the two majors differ:
62
+ * - PII: v10's `sendDefaultPii` defaults to false and is left at that (v11
63
+ * removed it, and v11's `withSentry` rejects a key it does not know). v11's
64
+ * replacement, `dataCollection`, collects cookies, bodies and local
65
+ * variables by default, so it is set; v10 ignores it.
66
+ * - Transactions: v11 ignores `beforeSendTransaction` by default (spans are
67
+ * streamed) and warns on every init when it is set. Transactions are
68
+ * scrubbed by an integration instead, which both majors run, and streamed
69
+ * spans by `beforeSendSpan`.
70
+ */
71
+
72
+ type Pattern = string | RegExp;
73
+ type AnyHook = (event: any, hint: any) => any;
74
+ type IntegrationLike = {
75
+ name: string;
76
+ processEvent?: (event: any, hint: any, client: any) => any;
77
+ };
78
+ type Integrations = IntegrationLike[] | ((defaults: any[]) => IntegrationLike[]);
79
+ type CollectBehavior = boolean | {
80
+ allow: string[];
81
+ } | {
82
+ deny: string[];
83
+ };
84
+ type HttpBody = "incomingRequest" | "outgoingRequest" | "incomingResponse" | "outgoingResponse";
85
+ /** v11's `dataCollection`, written out here so the package needs no SDK types and v10 sites typecheck too. */
86
+ interface DataCollection {
87
+ userInfo?: boolean;
88
+ cookies?: CollectBehavior;
89
+ httpHeaders?: CollectBehavior | {
90
+ request?: CollectBehavior;
91
+ response?: CollectBehavior;
92
+ };
93
+ httpBodies?: HttpBody[];
94
+ urlQueryParams?: CollectBehavior;
95
+ graphQL?: {
96
+ document?: boolean;
97
+ variables?: boolean;
98
+ };
99
+ genAI?: {
100
+ inputs?: boolean;
101
+ outputs?: boolean;
102
+ };
103
+ databaseQueryData?: boolean;
104
+ queues?: boolean;
105
+ stackFrameVariables?: CollectBehavior;
106
+ frameContextLines?: number;
107
+ }
108
+ /**
109
+ * The v11 equivalent of `sendDefaultPii: false`, a little tighter: no user
110
+ * info, cookies, bodies, bound query values, queue arguments, AI prompts or
111
+ * local variables (an enquiry handler's locals are the enquiry). Request
112
+ * headers and query strings stay, with the SDK's sensitive-value filter and
113
+ * then the scrubber over them, because they are what makes an error readable.
114
+ */
115
+ declare const DATA_COLLECTION: {
116
+ userInfo: false;
117
+ cookies: false;
118
+ httpHeaders: {
119
+ request: true;
120
+ response: false;
121
+ };
122
+ httpBodies: HttpBody[];
123
+ urlQueryParams: true;
124
+ graphQL: {
125
+ document: true;
126
+ variables: false;
127
+ };
128
+ genAI: {
129
+ inputs: false;
130
+ outputs: false;
131
+ };
132
+ databaseQueryData: false;
133
+ queues: false;
134
+ stackFrameVariables: false;
135
+ };
136
+ /** What every entry point accepts. Anything else is passed to `Sentry.init` untouched. */
137
+ interface PresetInput {
138
+ /** Defaults to `SENTRY_DSN`, `PUBLIC_SENTRY_DSN` or `NEXT_PUBLIC_SENTRY_DSN` in `env`. No DSN, no events. */
139
+ dsn?: string | null;
140
+ /** The variables to read: `import.meta.env`, `process.env`, or a Worker's `env`. */
141
+ env?: EnvSource;
142
+ /** Overrides the variables. `production`, `staging` or `preview`; `development`, `dev`, `local` and `test` turn reporting off. */
143
+ environment?: string | null;
144
+ /** Overrides the variables. The git SHA the build came from. */
145
+ release?: string | null;
146
+ /** Hosts that count as this site's own when deciding whether a failed fetch is third-party noise. The page's host always counts. */
147
+ firstPartyHosts?: readonly string[];
148
+ /** Added to the shared list, never instead of it. */
149
+ ignoreErrors?: Pattern[];
150
+ /** Added to the shared list, never instead of it. */
151
+ denyUrls?: Pattern[];
152
+ /** The site's own integrations. The scrubber's is added to them. */
153
+ integrations?: unknown;
154
+ /** Runs before the scrubber, which always has the last word. */
155
+ beforeSend?: AnyHook;
156
+ /** Replaces the span scrubber. Only for a site that scrubs spans itself. */
157
+ beforeSendSpan?: (span: any) => any;
158
+ /** Merged over {@link DATA_COLLECTION} (v11). */
159
+ dataCollection?: DataCollection;
160
+ tracesSampleRate?: number;
161
+ replaysSessionSampleRate?: number;
162
+ replaysOnErrorSampleRate?: number;
163
+ /** Only ever false, which is v10's default; it is left out of the options. Personal data reaches Sentry only by being named in a scope, and then the scrubber sees it. */
164
+ sendDefaultPii?: false;
165
+ [option: string]: unknown;
166
+ }
167
+ /** A hook that works as `beforeSend` on every Sentry SDK. */
168
+ type ScrubbingHook = <E extends object>(event: E, hint?: unknown) => E | null | PromiseLike<E | null>;
169
+ /** A hook that works as `beforeSendSpan` on every Sentry SDK. */
170
+ type SpanScrubbingHook = <S extends object>(span: S) => S;
171
+ /**
172
+ * What the preset sets on a server. Everything else in the input comes
173
+ * through as given. Every key here is one `@sentry/cloudflare` v11's strict
174
+ * `withSentry` accepts.
175
+ */
176
+ interface PresetDefaults {
177
+ dsn?: string;
178
+ environment: SentryEnvironment;
179
+ release?: string;
180
+ enabled?: boolean;
181
+ dataCollection: DataCollection;
182
+ ignoreErrors: Pattern[];
183
+ denyUrls: Pattern[];
184
+ integrations: Integrations;
185
+ beforeSend: ScrubbingHook;
186
+ beforeSendSpan: SpanScrubbingHook;
187
+ tracesSampleRate: number;
188
+ }
189
+ /** What the preset sets in a browser: the server's, plus replay rates when Replay is added. */
190
+ interface BrowserPresetDefaults extends PresetDefaults {
191
+ replaysSessionSampleRate?: number;
192
+ replaysOnErrorSampleRate?: number;
193
+ }
194
+ type Internal = "env" | "firstPartyHosts" | "sendDefaultPii" | "replaysSessionSampleRate" | "replaysOnErrorSampleRate";
195
+ type Preset<I extends PresetInput> = Omit<I, Internal | keyof PresetDefaults> & PresetDefaults;
196
+ type BrowserPreset<I extends PresetInput> = Omit<I, Internal | keyof BrowserPresetDefaults> & BrowserPresetDefaults;
197
+ interface Runtime {
198
+ /** Traces sampled when the input does not say. */
199
+ tracesSampleRate: number;
200
+ /** Browsers only: drop failed fetches to other sites, and set replay rates when Replay is added. */
201
+ browser: boolean;
202
+ }
203
+ declare function buildPreset<I extends PresetInput>(input: I, runtime: Runtime & {
204
+ browser: true;
205
+ }): BrowserPreset<I>;
206
+ declare function buildPreset<I extends PresetInput>(input: I, runtime: Runtime): Preset<I>;
207
+
208
+ export { type BrowserPreset as B, DATA_COLLECTION as D, ENVIRONMENTS as E, INGEST_HOST as I, type PresetInput as P, RELEASE_VARS as R, type ScrubbingHook as S, type BrowserPresetDefaults as a, type SpanScrubbingHook as b, type Preset as c, type PresetDefaults as d, DSN_VARS as e, type DataCollection as f, ENVIRONMENT_VARS as g, type EnvSource as h, type ResolvedEnvironment as i, type Runtime as j, SENTRY_ORG as k, type SentryEnvironment as l, buildPreset as m, normaliseDsn as n, resolveEnvironment as o, resolveRelease as p, resolveDsn as r };
@@ -0,0 +1,208 @@
1
+ /**
2
+ * Where environment, release and DSN come from. Every runtime hands its own
3
+ * variables over (`import.meta.env`, `process.env`, a Worker's `env`), because
4
+ * a library cannot read a browser bundle's variables for itself: bundlers only
5
+ * inline the names a consumer writes out literally.
6
+ */
7
+ /** The org every Doman Digital project lives in. */
8
+ declare const SENTRY_ORG = "domandigital";
9
+ /** The org's EU ingest host. DSNs minted before the org transfer still work, but name another org. */
10
+ declare const INGEST_HOST = "o4510784554991616.ingest.de.sentry.io";
11
+ /** The only environments a Doman Digital project reports under. */
12
+ declare const ENVIRONMENTS: readonly ["production", "staging", "preview"];
13
+ type SentryEnvironment = (typeof ENVIRONMENTS)[number];
14
+ /** Anything with string-ish values: `process.env`, `import.meta.env`, a Worker's `env`. */
15
+ type EnvSource = Readonly<Record<string, unknown>> | null | undefined;
16
+ /** Read in this order; the first non-empty value wins. */
17
+ declare const ENVIRONMENT_VARS: readonly ["SENTRY_ENVIRONMENT", "PUBLIC_SENTRY_ENVIRONMENT", "NEXT_PUBLIC_SENTRY_ENVIRONMENT", "VERCEL_ENV", "NEXT_PUBLIC_VERCEL_ENV"];
18
+ declare const RELEASE_VARS: readonly ["SENTRY_RELEASE", "PUBLIC_SENTRY_RELEASE", "NEXT_PUBLIC_SENTRY_RELEASE", "CF_PAGES_COMMIT_SHA", "WORKERS_CI_COMMIT_SHA", "VERCEL_GIT_COMMIT_SHA", "NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA", "GITHUB_SHA"];
19
+ declare const DSN_VARS: readonly ["SENTRY_DSN", "PUBLIC_SENTRY_DSN", "NEXT_PUBLIC_SENTRY_DSN"];
20
+ interface ResolvedEnvironment {
21
+ environment: SentryEnvironment;
22
+ /** False on a developer's machine (`development`, `dev`, `local`, `test`). */
23
+ enabled: boolean;
24
+ /** The variable it came from, `"explicit"`, or null when nothing was set. */
25
+ from: string | null;
26
+ }
27
+ /**
28
+ * `production`, `staging` or `preview`, from one variable. Never hardcode it:
29
+ * a preview deploy that says `production` pages people for nothing.
30
+ *
31
+ * Unset or unrecognised falls back to `preview`, so a forgotten variable shows
32
+ * up as preview noise rather than as a production incident.
33
+ */
34
+ declare function resolveEnvironment(input?: {
35
+ environment?: string | null;
36
+ env?: EnvSource;
37
+ }): ResolvedEnvironment;
38
+ /** The git SHA of the build, from whichever CI built it. Undefined when none is set. */
39
+ declare function resolveRelease(input?: {
40
+ release?: string | null;
41
+ env?: EnvSource;
42
+ }): string | undefined;
43
+ /**
44
+ * Rewrites a DSN that names a pre-transfer org host to {@link INGEST_HOST}.
45
+ * The key and project id are what route an event, so the old hosts work; they
46
+ * only confuse whoever reads the config next. Anything else is returned as is.
47
+ */
48
+ declare function normaliseDsn(dsn: string | null | undefined): string | undefined;
49
+ /** The DSN given, else the first of `SENTRY_DSN`, `PUBLIC_SENTRY_DSN`, `NEXT_PUBLIC_SENTRY_DSN`. */
50
+ declare function resolveDsn(input?: {
51
+ dsn?: string | null;
52
+ env?: EnvSource;
53
+ }): string | undefined;
54
+
55
+ /**
56
+ * The one builder behind every entry point. It returns plain `Sentry.init`
57
+ * options and imports no SDK, so the same code serves `@sentry/browser`,
58
+ * `@sentry/astro`, `@sentry/cloudflare` and `@sentry/nextjs` at whatever
59
+ * version the site has installed: v10 and v11 are both supported.
60
+ *
61
+ * Where the two majors differ:
62
+ * - PII: v10's `sendDefaultPii` defaults to false and is left at that (v11
63
+ * removed it, and v11's `withSentry` rejects a key it does not know). v11's
64
+ * replacement, `dataCollection`, collects cookies, bodies and local
65
+ * variables by default, so it is set; v10 ignores it.
66
+ * - Transactions: v11 ignores `beforeSendTransaction` by default (spans are
67
+ * streamed) and warns on every init when it is set. Transactions are
68
+ * scrubbed by an integration instead, which both majors run, and streamed
69
+ * spans by `beforeSendSpan`.
70
+ */
71
+
72
+ type Pattern = string | RegExp;
73
+ type AnyHook = (event: any, hint: any) => any;
74
+ type IntegrationLike = {
75
+ name: string;
76
+ processEvent?: (event: any, hint: any, client: any) => any;
77
+ };
78
+ type Integrations = IntegrationLike[] | ((defaults: any[]) => IntegrationLike[]);
79
+ type CollectBehavior = boolean | {
80
+ allow: string[];
81
+ } | {
82
+ deny: string[];
83
+ };
84
+ type HttpBody = "incomingRequest" | "outgoingRequest" | "incomingResponse" | "outgoingResponse";
85
+ /** v11's `dataCollection`, written out here so the package needs no SDK types and v10 sites typecheck too. */
86
+ interface DataCollection {
87
+ userInfo?: boolean;
88
+ cookies?: CollectBehavior;
89
+ httpHeaders?: CollectBehavior | {
90
+ request?: CollectBehavior;
91
+ response?: CollectBehavior;
92
+ };
93
+ httpBodies?: HttpBody[];
94
+ urlQueryParams?: CollectBehavior;
95
+ graphQL?: {
96
+ document?: boolean;
97
+ variables?: boolean;
98
+ };
99
+ genAI?: {
100
+ inputs?: boolean;
101
+ outputs?: boolean;
102
+ };
103
+ databaseQueryData?: boolean;
104
+ queues?: boolean;
105
+ stackFrameVariables?: CollectBehavior;
106
+ frameContextLines?: number;
107
+ }
108
+ /**
109
+ * The v11 equivalent of `sendDefaultPii: false`, a little tighter: no user
110
+ * info, cookies, bodies, bound query values, queue arguments, AI prompts or
111
+ * local variables (an enquiry handler's locals are the enquiry). Request
112
+ * headers and query strings stay, with the SDK's sensitive-value filter and
113
+ * then the scrubber over them, because they are what makes an error readable.
114
+ */
115
+ declare const DATA_COLLECTION: {
116
+ userInfo: false;
117
+ cookies: false;
118
+ httpHeaders: {
119
+ request: true;
120
+ response: false;
121
+ };
122
+ httpBodies: HttpBody[];
123
+ urlQueryParams: true;
124
+ graphQL: {
125
+ document: true;
126
+ variables: false;
127
+ };
128
+ genAI: {
129
+ inputs: false;
130
+ outputs: false;
131
+ };
132
+ databaseQueryData: false;
133
+ queues: false;
134
+ stackFrameVariables: false;
135
+ };
136
+ /** What every entry point accepts. Anything else is passed to `Sentry.init` untouched. */
137
+ interface PresetInput {
138
+ /** Defaults to `SENTRY_DSN`, `PUBLIC_SENTRY_DSN` or `NEXT_PUBLIC_SENTRY_DSN` in `env`. No DSN, no events. */
139
+ dsn?: string | null;
140
+ /** The variables to read: `import.meta.env`, `process.env`, or a Worker's `env`. */
141
+ env?: EnvSource;
142
+ /** Overrides the variables. `production`, `staging` or `preview`; `development`, `dev`, `local` and `test` turn reporting off. */
143
+ environment?: string | null;
144
+ /** Overrides the variables. The git SHA the build came from. */
145
+ release?: string | null;
146
+ /** Hosts that count as this site's own when deciding whether a failed fetch is third-party noise. The page's host always counts. */
147
+ firstPartyHosts?: readonly string[];
148
+ /** Added to the shared list, never instead of it. */
149
+ ignoreErrors?: Pattern[];
150
+ /** Added to the shared list, never instead of it. */
151
+ denyUrls?: Pattern[];
152
+ /** The site's own integrations. The scrubber's is added to them. */
153
+ integrations?: unknown;
154
+ /** Runs before the scrubber, which always has the last word. */
155
+ beforeSend?: AnyHook;
156
+ /** Replaces the span scrubber. Only for a site that scrubs spans itself. */
157
+ beforeSendSpan?: (span: any) => any;
158
+ /** Merged over {@link DATA_COLLECTION} (v11). */
159
+ dataCollection?: DataCollection;
160
+ tracesSampleRate?: number;
161
+ replaysSessionSampleRate?: number;
162
+ replaysOnErrorSampleRate?: number;
163
+ /** Only ever false, which is v10's default; it is left out of the options. Personal data reaches Sentry only by being named in a scope, and then the scrubber sees it. */
164
+ sendDefaultPii?: false;
165
+ [option: string]: unknown;
166
+ }
167
+ /** A hook that works as `beforeSend` on every Sentry SDK. */
168
+ type ScrubbingHook = <E extends object>(event: E, hint?: unknown) => E | null | PromiseLike<E | null>;
169
+ /** A hook that works as `beforeSendSpan` on every Sentry SDK. */
170
+ type SpanScrubbingHook = <S extends object>(span: S) => S;
171
+ /**
172
+ * What the preset sets on a server. Everything else in the input comes
173
+ * through as given. Every key here is one `@sentry/cloudflare` v11's strict
174
+ * `withSentry` accepts.
175
+ */
176
+ interface PresetDefaults {
177
+ dsn?: string;
178
+ environment: SentryEnvironment;
179
+ release?: string;
180
+ enabled?: boolean;
181
+ dataCollection: DataCollection;
182
+ ignoreErrors: Pattern[];
183
+ denyUrls: Pattern[];
184
+ integrations: Integrations;
185
+ beforeSend: ScrubbingHook;
186
+ beforeSendSpan: SpanScrubbingHook;
187
+ tracesSampleRate: number;
188
+ }
189
+ /** What the preset sets in a browser: the server's, plus replay rates when Replay is added. */
190
+ interface BrowserPresetDefaults extends PresetDefaults {
191
+ replaysSessionSampleRate?: number;
192
+ replaysOnErrorSampleRate?: number;
193
+ }
194
+ type Internal = "env" | "firstPartyHosts" | "sendDefaultPii" | "replaysSessionSampleRate" | "replaysOnErrorSampleRate";
195
+ type Preset<I extends PresetInput> = Omit<I, Internal | keyof PresetDefaults> & PresetDefaults;
196
+ type BrowserPreset<I extends PresetInput> = Omit<I, Internal | keyof BrowserPresetDefaults> & BrowserPresetDefaults;
197
+ interface Runtime {
198
+ /** Traces sampled when the input does not say. */
199
+ tracesSampleRate: number;
200
+ /** Browsers only: drop failed fetches to other sites, and set replay rates when Replay is added. */
201
+ browser: boolean;
202
+ }
203
+ declare function buildPreset<I extends PresetInput>(input: I, runtime: Runtime & {
204
+ browser: true;
205
+ }): BrowserPreset<I>;
206
+ declare function buildPreset<I extends PresetInput>(input: I, runtime: Runtime): Preset<I>;
207
+
208
+ export { type BrowserPreset as B, DATA_COLLECTION as D, ENVIRONMENTS as E, INGEST_HOST as I, type PresetInput as P, RELEASE_VARS as R, type ScrubbingHook as S, type BrowserPresetDefaults as a, type SpanScrubbingHook as b, type Preset as c, type PresetDefaults as d, DSN_VARS as e, type DataCollection as f, ENVIRONMENT_VARS as g, type EnvSource as h, type ResolvedEnvironment as i, type Runtime as j, SENTRY_ORG as k, type SentryEnvironment as l, buildPreset as m, normaliseDsn as n, resolveEnvironment as o, resolveRelease as p, resolveDsn as r };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * `thirdPartyErrorFilterIntegration` drops errors whose every frame is in code
3
+ * the site did not build. It needs the bundler plugin to tag the site's own
4
+ * files with the same key at build time, so it is only for builds that run
5
+ * the plugin: Next.js through `withSentryConfig` (webpack and Turbopack), and
6
+ * Vite or Astro through the Sentry Vite plugin. A Worker or Astro build whose
7
+ * maps go up with `dd-sentry-release` has no tag, and must not add it.
8
+ */
9
+ /** The key the bundler plugin tags first-party code with: `dd-<sentry project slug>`. */
10
+ declare function applicationKey(project: string): string;
11
+ /**
12
+ * Options for `Sentry.thirdPartyErrorFilterIntegration`, matched to
13
+ * {@link applicationKey}. Drops an error only when all of its frames are
14
+ * third-party; an error that passes through the site's code is kept.
15
+ */
16
+ declare function thirdPartyFilterOptions(project: string): {
17
+ filterKeys: string[];
18
+ behaviour: "drop-error-if-exclusively-contains-third-party-frames";
19
+ };
20
+
21
+ export { applicationKey as a, thirdPartyFilterOptions as t };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * `thirdPartyErrorFilterIntegration` drops errors whose every frame is in code
3
+ * the site did not build. It needs the bundler plugin to tag the site's own
4
+ * files with the same key at build time, so it is only for builds that run
5
+ * the plugin: Next.js through `withSentryConfig` (webpack and Turbopack), and
6
+ * Vite or Astro through the Sentry Vite plugin. A Worker or Astro build whose
7
+ * maps go up with `dd-sentry-release` has no tag, and must not add it.
8
+ */
9
+ /** The key the bundler plugin tags first-party code with: `dd-<sentry project slug>`. */
10
+ declare function applicationKey(project: string): string;
11
+ /**
12
+ * Options for `Sentry.thirdPartyErrorFilterIntegration`, matched to
13
+ * {@link applicationKey}. Drops an error only when all of its frames are
14
+ * third-party; an error that passes through the site's code is kept.
15
+ */
16
+ declare function thirdPartyFilterOptions(project: string): {
17
+ filterKeys: string[];
18
+ behaviour: "drop-error-if-exclusively-contains-third-party-frames";
19
+ };
20
+
21
+ export { applicationKey as a, thirdPartyFilterOptions as t };
package/package.json CHANGED
@@ -1,6 +1,111 @@
1
1
  {
2
2
  "name": "@domandigital/sentry",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.1",
4
+ "private": false,
5
+ "description": "One Sentry setup for every Doman Digital site: init options for the browser, Cloudflare Workers and Next.js (environment, release, PII scrubber, noise filters, sample rates), and a release and source-map CLI for Worker and Astro builds.",
6
+ "license": "Apache-2.0",
7
+ "type": "module",
8
+ "main": "dist/index.cjs",
9
+ "module": "dist/index.js",
10
+ "types": "dist/index.d.ts",
11
+ "sideEffects": false,
12
+ "bin": {
13
+ "dd-sentry-release": "dist/cli.js"
14
+ },
15
+ "exports": {
16
+ ".": {
17
+ "import": {
18
+ "types": "./dist/index.d.ts",
19
+ "default": "./dist/index.js"
20
+ },
21
+ "require": {
22
+ "types": "./dist/index.d.cts",
23
+ "default": "./dist/index.cjs"
24
+ }
25
+ },
26
+ "./browser": {
27
+ "import": {
28
+ "types": "./dist/browser.d.ts",
29
+ "default": "./dist/browser.js"
30
+ },
31
+ "require": {
32
+ "types": "./dist/browser.d.cts",
33
+ "default": "./dist/browser.cjs"
34
+ }
35
+ },
36
+ "./cloudflare": {
37
+ "import": {
38
+ "types": "./dist/cloudflare.d.ts",
39
+ "default": "./dist/cloudflare.js"
40
+ },
41
+ "require": {
42
+ "types": "./dist/cloudflare.d.cts",
43
+ "default": "./dist/cloudflare.cjs"
44
+ }
45
+ },
46
+ "./next": {
47
+ "import": {
48
+ "types": "./dist/next.d.ts",
49
+ "default": "./dist/next.js"
50
+ },
51
+ "require": {
52
+ "types": "./dist/next.d.cts",
53
+ "default": "./dist/next.cjs"
54
+ }
55
+ },
56
+ "./package.json": "./package.json"
57
+ },
58
+ "files": [
59
+ "CHANGELOG.md",
60
+ "LICENSE",
61
+ "README.md",
62
+ "dist"
63
+ ],
64
+ "dependencies": {
65
+ "@domandigital/synthetic": "^0.1.0"
66
+ },
67
+ "peerDependencies": {
68
+ "@sentry/nextjs": ">=10",
69
+ "sentry": ">=0.47"
70
+ },
71
+ "peerDependenciesMeta": {
72
+ "@sentry/nextjs": {
73
+ "optional": true
74
+ },
75
+ "sentry": {
76
+ "optional": true
77
+ }
78
+ },
79
+ "devDependencies": {
80
+ "@sentry/browser": "^11.5.0",
81
+ "@sentry/browser-v10": "npm:@sentry/browser@^10.76.1",
82
+ "@sentry/cloudflare": "^11.5.0",
83
+ "@sentry/core": "^11.5.0",
84
+ "@sentry/core-v10": "npm:@sentry/core@^10.76.1",
85
+ "@types/node": "^20.19.43",
86
+ "tsup": "^8.3.5",
87
+ "typescript": "^5.6.3",
88
+ "vitest": "^4.0.0"
89
+ },
90
+ "engines": {
91
+ "node": ">=22.12"
92
+ },
93
+ "repository": {
94
+ "type": "git",
95
+ "url": "git+https://github.com/Doman-Digital/dd-packages.git",
96
+ "directory": "packages/sentry"
97
+ },
98
+ "homepage": "https://github.com/Doman-Digital/dd-packages/tree/main/packages/sentry#readme",
99
+ "bugs": {
100
+ "url": "https://github.com/Doman-Digital/dd-packages/issues"
101
+ },
102
+ "publishConfig": {
103
+ "access": "public",
104
+ "provenance": true
105
+ },
106
+ "scripts": {
107
+ "build": "tsup",
108
+ "typecheck": "tsc --noEmit",
109
+ "test": "vitest run"
110
+ }
6
111
  }