> For the complete documentation index, see [llms.txt](https://docs.viverse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.viverse.com/polygon-streaming/integrations-and-plugins/polygon-streaming-playcanvas-sdk/plugin-usage/option-2-standalone-plugin.md).

# Option 2: Standalone Plugin

This document provides a guide for using the Standalone Plugin to integrate Polygon Streaming into a PlayCanvas project or for creating VIVERSE standalone apps.

***

### PlayCanvas Standalone Plugin

The standalone plugin can be used to publish projects in the PlayCanvas editor or to publish [standalone apps](/standalone-app-publishing/intro-to-standalone-app-publishing.md) on the VIVERSE platform. To do the latter you need to download the project and then upload it to VIVERSE Studio. See [Downloading your Project](#downloading-your-project) on what steps you need to take to get this to work.

{% stepper %}
{% step %}

#### Install the plugin

Download the latest version of the PlayCanvas standalone plugin [here](https://stream.viverse.com/assets/streamablemodel/2.9.3/playcanvas/PolygonStreaming-PlayCanvas-2.9.3.zip). Import the **polygon-streaming.js** and **ps-service-worker.js** scripts into the **Assets** window of the PlayCanvas project.

<figure><img src="https://3109683255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY3WbwobASVOf4RiqnLEI%2Fuploads%2FXVtnDPUMwvMhnuCGTY0S%2Fstandalone_plugin_scripts.png?alt=media&amp;token=2818ae6c-87c0-444d-9c50-bd092045b9ee" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Import Basis

The Basis library is needed for KTX textures which are used in Polygon Streaming models.

A. Click on the Settings button at the top.

B. Expand Rendering settings on the right.

C. Press the Import Basis button at the bottom of rendering settings.

<figure><img src="https://3109683255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY3WbwobASVOf4RiqnLEI%2Fuploads%2FG4igywPDWvtXm6LZBVIr%2Fstandalone_plugin_import_basis.png?alt=media&amp;token=7cdf25ef-4b39-4a4e-8aa6-715a4987974a" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Create the StreamController

A. Create a new entity and name it **StreamController**. This entity will control the streaming models inside the project.&#x20;

B. Add a script component to the entity and then add the **StreamController** script to the script component. You can check detailed information on these parameters [here](https://docs.viverse.com/polygon-streaming/integrations-and-plugins/polygon-streaming-playcanvas-sdk/polygon-streaming-project-settings).

C. Add the **Camera** entity from the project to the **Camera** field.

<figure><img src="https://3109683255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY3WbwobASVOf4RiqnLEI%2Fuploads%2FvVE8qlAlratfsCbk4x03%2Fstandalone_plugin_stream_controller.png?alt=media&amp;token=93866484-7383-492e-bba1-cc05843f7884" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Create the StreamableModel&#x20;

A. Create a new entity and name it **StreamableModel**.

B. Add a script component to the entity and then add the **StreamableModel** script to the script component. This will create the component to stream the model inside the scene.

C. Paste the **URL** address of your streaming model into the **Path or url to model** field. In the [Polygon Streaming console](https://stream.viverse.com/console/) you can get the URL of a model by clicking on the 3 dots on the top right hand corner of the model thumbnail and selecting Copy asset ID from the drop down menu.

<figure><img src="https://3109683255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY3WbwobASVOf4RiqnLEI%2Fuploads%2FvEJJhPWFpgColEXrnPsl%2Fstandalone_plugin_streamable_model.png?alt=media&amp;token=bd91b002-759a-4324-a4b8-169f56d52434" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Test the model

Launch the project in the PlayCanvas editor to test the streaming model.

<figure><img src="https://3109683255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY3WbwobASVOf4RiqnLEI%2Fuploads%2FkE4HYLMsQZPDtAoz2QyG%2Fstandalone_plugin_preview.png?alt=media&amp;token=cdcb9c2c-217f-410d-8646-91ad3d211180" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Downloading your project

The downloaded project zip file can be uploaded to VIVERSE Studio to publish on the VIVERSE platform as a [standalone app](/standalone-app-publishing/intro-to-standalone-app-publishing.md) or you can host the unzipped project files yourself.

A. Click on the Publish/Download button on the left.

B. Press the Download button in the top right of the Builds dialog.

C. In the Download New Build dialog uncheck Concatenate Scripts.

D. Press the Download button

E. Once PlayCanvas has built your project press the download button (downward arrow) on the right-hand side of the build.

G. If you are hosting the files yourself you need to copy **ps-service-worker.js** from the plugin into the root of the unzipped project.&#x20;

<figure><img src="https://3109683255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY3WbwobASVOf4RiqnLEI%2Fuploads%2FoAqFGmrLY8kQpGeXQe9s%2Fstandalone_plugin_download.png?alt=media&amp;token=5e5b6a33-a951-4267-b9ef-e8264c0be06b" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### Component Attributes

See [here](/polygon-streaming/integrations-and-plugins/polygon-streaming-playcanvas-sdk/plugin-usage/component-attributes.md) for a description of the attributes used in the Stream Controller and Streamable Model components.


---

# 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.viverse.com/polygon-streaming/integrations-and-plugins/polygon-streaming-playcanvas-sdk/plugin-usage/option-2-standalone-plugin.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.
