UNPKG

1.25 kBTypeScriptView Raw
1import type { BaseTransportOptions, Envelope, EnvelopeItemType, Event, Transport } from '@sentry/types';
2interface MatchParam {
3 /** The envelope to be sent */
4 envelope: Envelope;
5 /**
6 * A function that returns an event from the envelope if one exists. You can optionally pass an array of envelope item
7 * types to filter by - only envelopes matching the given types will be multiplexed.
8 * Allowed values are: 'event', 'transaction', 'profile', 'replay_event'
9 *
10 * @param types Defaults to ['event']
11 */
12 getEvent(types?: EnvelopeItemType[]): Event | undefined;
13}
14type RouteTo = {
15 dsn: string;
16 release: string;
17};
18type Matcher = (param: MatchParam) => (string | RouteTo)[];
19/**
20 * Gets an event from an envelope.
21 *
22 * This is only exported for use in the tests
23 */
24export declare function eventFromEnvelope(env: Envelope, types: EnvelopeItemType[]): Event | undefined;
25/**
26 * Creates a transport that can send events to different DSNs depending on the envelope contents.
27 */
28export declare function makeMultiplexedTransport<TO extends BaseTransportOptions>(createTransport: (options: TO) => Transport, matcher: Matcher): (options: TO) => Transport;
29export {};
30//# sourceMappingURL=multiplexed.d.ts.map
\No newline at end of file