# Add Code

Now that you are able to embed the Scene Viewer experience generated and hosted through the console, it's time to inject your own scripts into the webpage.

{% hint style="success" %}
Adding scripts into webAR experiences is only available in the [Custom](mailto:sales@echo3D.com) plan.
{% endhint %}

If you'd like to inject your own JavaScript scripts into the webpage, go back to the console and [add metadata](https://docs.echoar.xyz/web-console/manage-pages/data-page/how-to-add-data#adding-metadata) to add code to the experience. After adding metadata, [relaunch the experience](https://docs.echoar.xyz/scene-viewer/deploy-experience#launching-the-scene-viewer-app).

The following keys are words the system uses as pre-defined metadata keys to control built-in animations:

| Keyword         | Type   | Options                                                       | Description                                                                      |
| --------------- | ------ | ------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| webarScript\<X> | string | Any string that represents a URL to a remote JavaScript file. | The remote URL of a JavaScript code file that will be injected into the webpage. |
| <p>webarOnClick |        |                                                               |                                                                                  |

</p><p></p><p></p> | string | Any string that matches a name of an existing function to be called upon click. The function must be followed by brackets `()`, either empty or with arguments. | Runs a specific function when clicking the webpage.                              |

For example:

| Key          | Value                                               |
| ------------ | --------------------------------------------------- |
| webScript1   | <https://code.jquery.com/jquery-3.5.0.js>           |
| webScript2   | <https://www.company.me/path-to-javascript-file.js> |
| webarOnClick | createCache()                                       |

Remember to [relaunch the experience](https://docs.echoar.xyz/scene-viewer/deploy-experience#launching-the-scene-viewer-app) after adding metadata with Scene Viewer experiences for the change to take effect.[<br>](https://docs.echoar.xyz/scene-viewer/deploy-experience)


---

# Agent Instructions: 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:

```
GET https://docs.echo3d.com/scene-viewer/add-code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
