> 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/bim/setup-client.md).

# Setting up WebViewer BIM Client

Discover how to set up WebViewer BIM Client seamlessly. Learn the essential steps to configure both client and server, enabling smooth communication for your web application. The Apryse Web SDK stream

{% hint style="info" %}
New licenses for WebViewer BIM are no longer offered.
{% endhint %}

To get the sample working, both WebViewer BIM client and server must be setup and running. The server URL will be referenced in the front-end to allow communication between client and server.

## Prerequisites

It is recommended you install [Node](https://nodejs.org/) and [npm](https://www.npmjs.com/).

<a href="https://github.com/ApryseSDK/webviewer-BIM-sample" class="button primary">Get the React sample source code here</a>

## Setup application

1. Run the following:

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

```bash
git clone --depth=1 https://github.com/ApryseSDK/webviewer-samples.git
cd webviewer-samples/webviewer-BIM
npm install
```

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

1. Change `serverURL` variable in `App.js` to wherever your server is hosted. See [Setting up WebViewer BIM Server](/web/bim/setup-server.md) section for details.

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

```js
WebViewer({ path: "/webviewer/lib" }, viewer.current).then(async (instance) => {
  const license = `---- Insert commercial license key here after purchase ----`;
  const serverURL = `---- Insert server URL after setup ----`;

  const options = getViewerOptions(license);
  const webviewerBIM = await initializeBimViewer(instance, serverURL, options);
  webviewerBIM.File.load3dAsset(
    "Add URL to your 3D asset here"
  );
});
```

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

## Run application

After setup is complete, run the application:

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

```bash
npm start
```

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

## Include credentials in cross-origin BIM requests

The following APIs accept a `withCredentials` boolean property in their respective options parameters:

* [load3dAsset](/web/bim/api.md#load3dasset)
* [preload3dAsset](/web/bim/api.md#preload3dasset)
* [loadCached3dAsset](/web/bim/api.md#loadcached3dasset)
* [checkAssetConversionProgress](/web/bim/api.md#checkassetconversionprogress)

If enabled, the underlying Fetch requests have `{ credentials: 'include' }` added to the options parameter. See the [Fetch MDN documentation](https://developer.mozilla.org/en-US/docs/Web/API/fetch#include) and [WHATWG 'credentials' definition](https://fetch.spec.whatwg.org/#credentials) for more information on automatically including credentials in cross-origin requests.

The BIM server must have `allow_credentials` enabled, and a non-wildcard value specifed in `allow_origins`, otherwise the browser will throw a CORS error. See [configuring cross-origin credentials](/web/bim/setup-server.md#include-credentials-in-crossorigin-bim-requests) documentation for server-side configuration steps.

**NOTE:** The WebViewer BIM custom authorization is not affected by this functionality. If you enabled server-side authorization, ensure the authorization tokens are included in their respective APIs.


---

# 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/bim/setup-client.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.
