> For the complete documentation index, see [llms.txt](https://docs.roomle.com/rubens/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roomle.com/rubens/rubens-sdk/rubens-3d-viewer-and-ar/getting-started.md).

# Getting started

### Initial commit <a href="#initial-commit" id="initial-commit"></a>

First of all we need to add `@roomle/web-sdk` to our npm dependencies and setup a build process. To finally load something you will need to do the following:

```typescript
    import RoomleSdk from "@roomle/web-sdk";
    // set the URL from where you want to load
    // the data, normally that's api.roomle.com/v2
    RoomleSdk.setGlobalInitData({
        customApiUrl: "https://api.roomle.com/v2",
    });

    const glbViewerawait = RoomleSdk.getGlbViewer();
    glbViewer.boot();
    glbViewerApi = await glbViewer.getApi();
    const scene = document.querySelector(".scene");
    await glbViewerApi.init(scene);
    // Load a static item by the id
    await glbViewerApi.loadStaticItem("roomle_content_demo:kitchenware003");
```

### Loading different items <a href="#loading-different-items" id="loading-different-items"></a>

If you finished step one you where already able to load a static item. You only need to bind the method `loadStaticItem` to a click event. We suggest something like:

```typescript
const loadObject = async (id: string) => {
  await glbViewerApi.loadStaticItem(id);
}
```

### Opening AR <a href="#opening-ar" id="opening-ar"></a>

To open AR you can use the quick-look features of Android and iOS. For Android a [GLB ](https://en.wikipedia.org/wiki/GlTF#GLB)is needed and for iOS a [USDZ ](https://en.wikipedia.org/wiki/Universal_Scene_Description)file.

To fetch the URL of the GLB you can use the module Rapi Access. This works as follows:

```typescript
const rapiAccess = await RoomleSdk.getRapiAccess();
const itemData = await rapiAccess.getItem(initialId);
const { assets } = await rapiAccess.getItem(id);
const arUrl = isIOs() ? assets.usdz.url : createAndroidARUrl(assets.glb.url);
```

For platform specific details please visit one of the following links:

* Android: <https://developers.google.com/ar/develop/java/scene-viewer>
* iOS <https://developer.apple.com/augmented-reality/quick-look/>

### Code Sandbox <a href="#code-sandbox" id="code-sandbox"></a>

Since we only showed the relevant code in the snippets it's time to have a look on the working example. You can find it [here in our CodeSandbox](https://codesandbox.io/s/roomlewebsdkglbviewer-t3rme) example.


---

# 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.roomle.com/rubens/rubens-sdk/rubens-3d-viewer-and-ar/getting-started.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.
