Note: This API isn't intended for use when extending sites in Wix Studio or the Wix Editor, when coding in Blocks, or in self-managed headless projects. It requires the Wix runtime, so it isn't available when you host your own project. Studio Two sites can use this API.
The monitoring submodule lets you report errors, log messages, and track performance in your code.
Important: Where your reports go depends on the type of project:
For apps that report to Sentry, Wix reports unhandled errors to your Sentry project automatically after it recognizes the changes to your wix.config.json file.
@wix/essentials and the Wix CLI installed.
In order to use the monitoring client and report events, you need to initialize it.
captureException()Captures an exception and reports it.
| Name | Type | Description |
|---|---|---|
error | Error | The error to capture. |
captureContext | CaptureContext | (Optional) Additional context to attach to the report. |
captureContext.level | string | (Optional) Event severity level. Options: info, warning, error. Default: error. |
captureContext.tags | object | (Optional) Key-value pairs to attach to the report. For how Sentry uses tags, see usage and limitations. |
captureContext.contexts | object | (Optional) Groups of related values to attach to the report. For how Sentry uses contexts, see usage and limitations. |
captureMessage()Captures a message and reports it.
| Name | Type | Description |
|---|---|---|
message | string | Message to capture. |
captureContext | CaptureContext | (Optional) Additional context to attach to the report. |
captureContext.level | string | (Optional) Event severity level. Options: info, warning, error. Default: info. |
captureContext.tags | object | (Optional) Key-value string pairs to attach to the report. For how Sentry uses tags, see usage and limitations. |
captureContext.contexts | object | (Optional) Groups of related values to attach to the report. For how Sentry uses contexts, see usage and limitations. |
addBreadcrumb()Records a new breadcrumb which will be attached to future events. Breadcrumbs will be added to subsequent events to provide more context on user's actions prior to an error or crash.
Wix records breadcrumbs only for reports that go to Sentry. In Studio Two sites, this method has no effect.
| Name | Type | Description |
|---|---|---|
breadcrumb | Breadcrumb | Breadcrumb details. Learn more about these properties |
breadcrumb.message | string | Breadcrumb message. |
breadcrumb.type | string | (Optional) Breadcrumb type. |
breadcrumb.category | string | (Optional) Breadcrumb category. |
breadcrumb.level | string | (Optional) Breadcrumb severity level. Options: info, warning, error. |
breadcrumb.data | object | (Optional) Additional data to attach to the breadcrumb. |
startSpan()Starts a new span and executes the provided callback function with the span as an argument.
| Name | Type | Description |
|---|---|---|
spanOptions | SpanOptions | Span options. |
spanOptions.name | string | Span name. |
spanOptions.tags | Tags | (Optional) Key-value string pairs to attach to the span. |
callback | (span: Span | undefined) => T | Callback function to execute with the span. |
startSpanManual()Starts a new span that requires manual completion. Complete this span manually by calling end() or fail() using the returned span object or by calling endSpanManual().
| Name | Type | Description |
|---|---|---|
spanOptions | SpanOptions | Span options. |
spanOptions.name | string | Span name. |
spanOptions.tags | Tags | (Optional) Key-value string pairs to attach to the span. |
endSpanManual()Ends the most recent span that was started using startSpanManual(). Any older manual spans with the same name will be ignored.
| Name | Type | Description |
|---|---|---|
spanOptions | SpanOptions | Span options. |
spanOptions.name | string | Span name. |
This section applies to reports that go to Sentry. For the fields in a Studio Two log entry, see Log Entry Structure in Studio Two.
Each report we send to Sentry is enriched with additional information that will help you find the root of the problem. The context object will vary slightly depending on the report, but will generally include the following:
| Name | Description |
|---|---|
app.id | Your app ID. |
extension.id | Your unique extension ID. |
extension.name | Your extension name. For backend extensions this could also be the name of an endpoint or webhook. |
extension.type | Extension type. For backend extensions types include: cli-api, cli-event, cli-service-plugin. |
platform | Platform where the error originated. Possible Values: BACKEND, DASHBOARD, SITE_EDITOR, SITE_VIEWER. |
url | URL of the site where the error originated. Only relevant for site extensions. |
Last updated: 11 November 2026