---
title: "ModuleMetadata"
description: "Adds module metadata to stack frames."
url: https://docs.sentry.io/platforms/javascript/guides/astro/configuration/integrations/modulemetadata/
---

# ModuleMetadata | Sentry for Astro

This integration only works inside a browser environment.

*Import name: `Sentry.moduleMetadataIntegration`*

Metadata can be injected by the Sentry bundler plugins using the `_experiments.moduleMetadata` config option. Once this integration is added, the metadata passed to the bundler plugin will be added to the stack frames of all events under the `module_metadata` property. This can be used to help tag or route events from different teams or sources.

**npm**

```javascript
import * as Sentry from "<sdk-package-name>";

Sentry.init({
  dsn: "https://<key>@o<orgId>.ingest.sentry.io/<projectId>",
  integrations: [Sentry.moduleMetadataIntegration()],
});
```

**Loader**

```html
<script>
  // Configure sentryOnLoad before adding the Loader Script
  window.sentryOnLoad = function () {
    Sentry.init({
      integrations: [Sentry.moduleMetadataIntegration()],
    });
  };
</script>

<script
  src="https://js.sentry-cdn.com/<your-public-key>.min.js"
  crossorigin="anonymous"
></script>
```

**CDN**

```html
<script
  src="https://browser.sentry-cdn.com/10.56.0/bundle.tracing.min.js"
  integrity="sha384-jgwGVk6gY4nf+Tf788HcxJ0klMbCxd3TP+V7tMuXC/a7fqmtjNQyxFMhPmI5Pyhp"
  crossorigin="anonymous"
></script>

<script>
  Sentry.init({
    dsn: "https://<key>@o<orgId>.ingest.sentry.io/<projectId>",
    integrations: [Sentry.moduleMetadataIntegration()],
  });
</script>
```
