diff --git a/docs/platforms/javascript/common/best-practices/shared-environments.mdx b/docs/platforms/javascript/common/best-practices/shared-environments.mdx index 4c3372127ad50..805504d6ed3f9 100644 --- a/docs/platforms/javascript/common/best-practices/shared-environments.mdx +++ b/docs/platforms/javascript/common/best-practices/shared-environments.mdx @@ -99,6 +99,19 @@ try { } ``` +## Sending logs from shared environments + +You can pass the scope directly into the logger API methods to make shared environments work. + +```js +const scope = new Scope(); +scope.setClient(client); + +client.init(); // initializing has to be done after setting the client on the scope + +Sentry.logger.info("my logger message", {}, { scope }); +``` + ## Browser Extension Filter If you notice that Sentry is not capturing error events from the browser extension, an Inbound Filter might be active.