diff --git a/src/platforms/javascript/common/configuration/micro-frontend-support.mdx b/src/platforms/javascript/common/configuration/micro-frontend-support.mdx index 9d454ed34341d..2bb758fdc8ccd 100644 --- a/src/platforms/javascript/common/configuration/micro-frontend-support.mdx +++ b/src/platforms/javascript/common/configuration/micro-frontend-support.mdx @@ -96,8 +96,21 @@ fallback DSN defined in `Sentry.init`. ```typescript import { captureException, init, makeFetchTransport } from "@sentry/browser"; import { makeMultiplexedTransport } from "@sentry/core"; +import { Envelope, EnvelopeItemType } from "@sentry/types"; -function dsnFromFeature({ getEvent }) { +interface MatchParam { + /** The envelope to be sent */ + envelope: Envelope; + /** + * A function that returns an event from the envelope if one exists. You can optionally pass an array of envelope item + * types to filter by - only envelopes matching the given types will be returned. + * + * @param types Defaults to ['event'] (only error events will be returned) + */ + getEvent(types?: EnvelopeItemType[]): Event | undefined; +} + +function dsnFromFeature({ getEvent }: MatchParam) { const event = getEvent(); switch (event?.tags?.feature) { case "cart": @@ -129,31 +142,6 @@ You can then set tags/contexts on events in individual micro-frontends to decide containing the DSN and optionally the release. ```typescript -type EnvelopeItemType = - | "client_report" - | "user_report" - | "session" - | "sessions" - | "transaction" - | "attachment" - | "event" - | "profile" - | "replay_event" - | "replay_recording" - | "check_in"; - -interface MatchParam { - /** The envelope to be sent */ - envelope: Envelope; - /** - * A function that returns an event from the envelope if one exists. You can optionally pass an array of envelope item - * types to filter by - only envelopes matching the given types will be returned. - * - * @param types Defaults to ['event'] (only error events will be returned) - */ - getEvent(types?: EnvelopeItemType[]): Event | undefined; -} - interface RouteTo { dsn: string; release?: string;