Skip to content

ref(core): Move allowUrls and denyUrls options into core #6317

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 1 commit into from
Nov 30, 2022
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
20 changes: 2 additions & 18 deletions packages/browser/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,17 @@ import { Breadcrumbs } from './integrations';
import { BREADCRUMB_INTEGRATION_ID } from './integrations/breadcrumbs';
import { BrowserTransportOptions } from './transports/types';

export interface BaseBrowserOptions {
/**
* A pattern for error URLs which should exclusively be sent to Sentry.
* This is the opposite of {@link Options.denyUrls}.
* By default, all errors will be sent.
*/
allowUrls?: Array<string | RegExp>;

/**
* A pattern for error URLs which should not be sent to Sentry.
* To allow certain errors instead, use {@link Options.allowUrls}.
* By default, all errors will be sent.
*/
denyUrls?: Array<string | RegExp>;
}

/**
* Configuration options for the Sentry Browser SDK.
* @see @sentry/types Options for more information.
*/
export interface BrowserOptions extends Options<BrowserTransportOptions>, BaseBrowserOptions {}
export type BrowserOptions = Options<BrowserTransportOptions>;

/**
* Configuration options for the Sentry Browser SDK Client class
* @see BrowserClient for more information.
*/
export interface BrowserClientOptions extends ClientOptions<BrowserTransportOptions>, BaseBrowserOptions {}
export type BrowserClientOptions = ClientOptions<BrowserTransportOptions>;

/**
* The Sentry Browser SDK Client.
Expand Down
18 changes: 18 additions & 0 deletions packages/types/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,24 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
[key: string]: any;
};

/**
* A pattern for error URLs which should exclusively be sent to Sentry.
* This is the opposite of {@link Options.denyUrls}.
* By default, all errors will be sent.
*
* Requires the use of the `InboundFilters` integration.
*/
allowUrls?: Array<string | RegExp>;

/**
* A pattern for error URLs which should not be sent to Sentry.
* To allow certain errors instead, use {@link Options.allowUrls}.
* By default, all errors will be sent.
*
* Requires the use of the `InboundFilters` integration.
*/
denyUrls?: Array<string | RegExp>;

/**
* Function to compute tracing sample rate dynamically and filter unwanted traces.
*
Expand Down