> For the complete documentation index, see [llms.txt](https://docs.lookingglassfactory.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lookingglassfactory.com/~/changes/b9fBkWdLSF9K8Hgxeaau/legacy-products/corejs.md).

# Looking Glass Core JS

(last updated July 2024)

{% hint style="warning" %}
**Note:** Looking Glass Core JS is no longer being actively developed. Please instead see [Looking Glass Bridge SDK](https://docs.lookingglassfactory.com/~/changes/b9fBkWdLSF9K8Hgxeaau/core/looking-glass-bridge-sdk.md) which includes [Bridge.js](https://github.com/Looking-Glass/bridge.js) which supports all of the same features and more.&#x20;

Looking Glass Core (previously HoloPlay Core) apps will continue to work with Looking Glass displays sold prior to 2024.
{% endhint %}

This JavaScript library makes developing custom web-based holographic applications or integrating existing web-based rendering software with Looking Glass displays easy. With HoloPlayCore.js, developers can now interact with HoloPlay Service and obtain necessary information from the Looking Glass.

You can use this library to build a variety of web apps ranging from a simple gallery for displaying quilts to a complete 3D rendering program. For an example implementation of how to use looking glass core.js to develop web-based 3D rendering program, review the [**HoloPlay.js**](https://github.com/Looking-Glass/gitbook-docs/blob/main/core/corejs/broken-reference/README.md) source code and its documentation, though note that this library has now been designated legacy software as it is no longer being actively maintained.

## Features

* A client to communicate with HoloPlay Service.
* Shows calibration data and window information.
* Pre-defined Message objects make communication easier.
* Quilt loading and viewing functionality (see [**ShowMessage**](https://docs.lookingglassfactory.com/~/changes/b9fBkWdLSF9K8Hgxeaau/legacy-products/corejs/api/message.md) for more details).

## Requirements

The end user must have [**Looking Glass Bridge**](https://lookingglassfactory.com/software/holoplay-service) installed on their machine.

## Quick Start

### Installation

From [**npm**](https://www.npmjs.com/package/holoplay-core)**:**

```
npm install --save holoplay-core
```

From CDN:

```
<script src="https://unpkg.com/holoplay-core"></script>
```

### Usage

Include in html with script tag: (use `holoplaycore.min.js` for the minified version)

```javascript
<script src="./node_modules/holoplay-core/dist/holoplaycore.js"></script>
<script>
  const client = new HoloPlayCore.Client(
      (msg) => {
        console.log('Calibration values:', msg);
      },
      (err) => {
        console.error('Error creating HoloPlay client:', err);
      });
</script>
```

or skip the script tag and import the ES6 module (note the different filename!):

```javascript
<script type="module">
  import * as HoloPlayCore from './node_modules/holoplay-core/dist/holoplaycore.module.js';
  const client = new HoloPlayCore.Client(
      (msg) => {
        console.log('Calibration values:', msg);
      },
      (err) => {
        console.error('Error creating HoloPlay client:', err);
      });
</script>
```

or in Node:

```javascript
const HoloPlayCore = require('holoplay-core');
const client = new HoloPlayCore.Client(
      (msg) => {
        console.log('Calibration values:', msg);
      },
      (err) => {
        console.error('Error creating HoloPlay client:', err);
      });
```

## API References

Visit our documentation on the [**HoloPlayCore.js API**](https://docs.lookingglassfactory.com/~/changes/b9fBkWdLSF9K8Hgxeaau/legacy-products/corejs/api.md) for more detailed support on how to effectively use and integrate HoloPlayCore.js into your application.

## Examples

Visit our documentation on HoloPlayCore.js [**example**](https://docs.lookingglassfactory.com/~/changes/b9fBkWdLSF9K8Hgxeaau/legacy-products/corejs/api/examples.md) code for more details on implementation.

## Questions

Email us at <support@lookingglassfactory.com> if you have any further questions about how you can integrate HoloPlay Core into your software.


---

# 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.lookingglassfactory.com/~/changes/b9fBkWdLSF9K8Hgxeaau/legacy-products/corejs.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.
