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