> 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/collaboration/realtime-collaboration-setup.md).

# Setting up WebViewer for real-time document collaboration

Easily set up WebViewer for seamless document collaboration. Follow these steps to integrate WebViewer into your web application for real-time sharing and editing. The Apryse Web SDK streamlines secur

1. Download the WebViewer SDK and unzip the package.

{% @apryse-download-button/apryse-download-button id="WebViewer\_web\_web" title="Download WebViewer" showVersion="true" %}

2. Copy lib/ folder to a location on your web server.
3. Create an HTML page.
4. Add the WebViewer script to the `<head>` of the HTML page.

{% tabs %}
{% tab title="HTML" %}
{% code lineNumbers="true" %}

```html
<script src="lib/webviewer.min.js"></script>
```

{% endcode %}
{% endtab %}
{% endtabs %}

1. Add necessary scripts server methods. In this guide, we are going to include Firebase library and a separate file named `server.js`

{% tabs %}
{% tab title="HTML" %}
{% code lineNumbers="true" %}

```html
<script src="https://www.gstatic.com/firebasejs/3.5.3/firebase.js"></script>
<script src="server.js"></script>
```

{% endcode %}
{% endtab %}
{% endtabs %}

1. Add a script to initiate and use WebViewer.

{% tabs %}
{% tab title="HTML" %}
{% code lineNumbers="true" %}

```html
<script src="main.js"></script>
```

{% endcode %}
{% endtab %}
{% endtabs %}

1. Create a `<div>` tag in the HTML `<body>` and give it an id. This will be the container for the WebViewer

{% tabs %}
{% tab title="HTML" %}
{% code lineNumbers="true" %}

```html
<div id="viewer"></div>
```

{% endcode %}
{% 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
