---
title: "Audit mustEnable Plugin"
description: "Use the Lytics JSTag audit.mustEnable plugin API to opt a plugin into the pattern of being disabled by default until explicitly enabled by configuration."
url: "https://www.contentstack.com/docs/developers/sdks/lytics/web/jstag-plugin-audit-mustenable"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-11-05"
---

# Audit mustEnable Plugin

Plugin API for opting into the pattern of plugins that must be explicitly enabled

## audit.mustEnable plugin

A Plugin API for opting into the pattern of plugins that are disabled by default and must be explicitly enabled by configuration.

Audit mustEnable

namespace audit.mustEnable

plugin API

always on

### Plugin API

#### mustEnable(): void

Declare that your plugin must be enabled. Any subsequent code will run only when the plugin is enabled by configuration.

```
jstag.use(plugin => {
  plugin.ns("myPlugin");

  plugin.defaults({
    myPlugin: {
      disabled: true
    }
  });

  plugin.mustEnable();

  // This code is unreachable unless the plugin is enabled
});
```

#### Mechanism

This plugin implements non-local return using JavaScript's throw keyword.