> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/web/redaction/redaction-setup.md).

# Setting up redaction in WebViewer

Discover how to set up redaction in WebViewer efficiently. Enable redaction property, configure fullAPI or webviewerServerURL for applying redactions seamlessly. Toggle redaction with WebViewer API ef

{% hint style="info" %}
**Requirements**

*These packages are required to use these features in production. Trial keys have unlimited access to all features*

<a href="https://apryse.com/capabilities#Redaction" class="button primary">Package: Redaction</a><a href="https://showcase.apryse.com/redaction" class="button primary">Live demo</a>
{% endhint %}

When creating a new instance of WebViewer, the `enableRedaction` property needs to be set to true for users to create new redactions and the `fullAPI` or `webviewerServerURL` properties need to be setup to be able to apply redactions. It's possible to use redactions with only `enableRedaction`, but users won't be able to apply redactions.

{% tabs %}
{% tab title="JavaScript (SDK v8.0+)" %}
{% code lineNumbers="true" %}

```js
WebViewer({
  ... // other options
  fullAPI: true,
  // can also use 'webviewerServerURL' instead of 'fullAPI'
  // webviewerServerURL: 'https://demo.apryse.com/'
  enableRedaction: true
}, viewerElement)
  .then(instance => {
    // optionally you can switch to the redaction tool immediately
    const { Tools } = instance.Core;
    instance.UI.setToolMode(Tools.ToolNames.REDACTION);
  });
```

{% endcode %}

[WebViewerInstance](https://sdk.apryse.com/api/web/WebViewerInstance.html)
{% endtab %}

{% tab title="JavaScript (SDK v6.0+)" %}
{% code lineNumbers="true" %}

```js
WebViewer({
  ... // other options
  fullAPI: true,
  // can also use 'pdftronServer' instead of 'fullAPI'
  // pdftronServer: 'https://demo.apryse.com/'
  enableRedaction: true
}, viewerElement)
  .then(instance => {
    // optionally you can switch to the redaction tool immediately
    const { Tools } = instance;
    instance.setToolMode(Tools.ToolNames.REDACTION);
  });
```

{% endcode %}

[WebViewerInstance](https://sdk.apryse.com/api/web/WebViewerInstance.html)
{% endtab %}
{% endtabs %}

Besides passing in a constructor option, redaction can be toggled using the WebViewer API with the `enableFeatures` and `disableFeatures` functions.

{% tabs %}
{% tab title="JavaScript (SDK v8.0+)" %}
{% code lineNumbers="true" %}

```js
WebViewer({
  ... // other options
}, viewerElement)
  .then(instance => {
    instance.UI.enableFeatures([instance.UI.Feature.Redaction]);
  });
```

{% endcode %}

[WebViewer.UI.enableFeatures](https://sdk.apryse.com/api/web/UI.html#enableFeatures__anchor) [WebViewer.UI.disableFeatures](https://sdk.apryse.com/api/web/UI.html#disableFeatures__anchor)
{% endtab %}

{% tab title="JavaScript (SDK v6.0+)" %}
{% code lineNumbers="true" %}

```js
WebViewer({
  ... // other options
}, viewerElement)
  .then(instance => {
    instance.enableFeatures([instance.Feature.Redaction]);
  });
```

{% endcode %}

[WebViewer.enableFeatures](https://sdk.apryse.com/api/web/UI.html#enableFeatures__anchor) [WebViewer.disableFeatures](https://sdk.apryse.com/api/web/UI.html#disableFeatures__anchor)
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/web/redaction/redaction-setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
