# @matterport/webcomponent

> ⚠️ **Note that the Matterport Web Component is currently in public beta - interface and syntax are subject to change.** ⚠️ Please email [developer@matterport.com](mailto:developer@matterport.com) with any suggestions or questions.

Latest version **0.1.47** (published 2026-06-02) · SEE LICENSE IN LICENSE.md license · 0 weekly downloads

## Install

```sh
npm install @matterport/webcomponent
pnpm add @matterport/webcomponent
yarn add @matterport/webcomponent
bun add @matterport/webcomponent
```

Provides the command `matterport-assets`.

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; large bundle; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.47 |
| Published | 2026-06-02 |
| First published | 2023-01-25 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE.md |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 31.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | wmak, dtaub, gbruce, dustcook, marleneondrovich |

## Links

- npm: https://www.npmjs.com/package/@matterport/webcomponent
- npm.io page: https://npm.io/package/@matterport/webcomponent

## Dependencies (1)

- [lit](https://npm.io/package/lit.md) ^2.4.1

## Recent versions

- 0.1.47 (latest) — 2026-06-02
- 0.1.46 — 2026-06-01
- 0.1.45 — 2025-07-29
- 0.1.44 — 2025-03-28
- 0.1.43 — 2024-11-12
- 0.1.42 — 2024-10-24
- 0.1.39 — 2024-03-15
- 0.1.38 — 2024-01-19
- 0.1.37 — 2023-12-14
- 0.1.36 — 2023-11-22
- 0.1.35 — 2023-10-26
- 0.1.34 — 2023-10-13
- 0.1.32 — 2023-09-22
- 0.1.30 — 2023-08-23
- 0.1.29 — 2023-08-16
- … 16 more at https://npm.io/package/@matterport/webcomponent/versions

## README

⚠️ **Note that the Matterport Web Component is currently in public beta - interface and syntax are subject to change.** ⚠️ Please email [developer@matterport.com](mailto:developer@matterport.com) with any suggestions or questions.

See [here](https://matterport.github.io/developer-docs/webcomponent/) for full documentation, or keep reading for quick instructions.

# Installation

Run these commands in your project:

```sh
# `three` v0.184.0 is a required peer dependency
yarn add @matterport/webcomponent three@0.184.0

# replace `public` with your static assets directory (static, public, etc)
# this copies the required assets to your project
yarn matterport-assets YOUR_ASSET_DIRECTORY

# npm is also supported:
npm install @matterport/webcomponent three@0.184.0
# if using npm, use `npx` next:
npx matterport-assets YOUR_ASSET_DIRECTORY
```

Then import `@matterport/webcomponent` somewhere in your source:

```js
import '@matterport/webcomponent'
```

To use, add a `<matterport-viewer>` component with a model ID as the `m` attribute:

```html
<matterport-viewer m="SxQL3iGyoDo"></matterport-viewer>
```

If you used any nested directories when running the `matterport-assets` command, set the `asset-base` attribute to match:

```html
<!-- if you ran `yarn matterport-assets foo/bar`, use: -->
<matterport-viewer m="SxQL3iGyoDo" asset-base="bar"></matterport-viewer>

<!-- if you ran `yarn matterport-assets foo/bar/baz`, use: -->
<matterport-viewer m="SxQL3iGyoDo" asset-base="bar/baz"></matterport-viewer>

<!-- if you ran `yarn matterport-assets foo`, no asset-base attribute is needed: -->
<matterport-viewer m="SxQL3iGyoDo"></matterport-viewer>
```

You can add any [URL param](https://support.matterport.com/s/article/URL-Parameters?language=en_US&ardId=kA05d000001DWztCAG) as an attribute:

```html
<matterport-viewer m="SxQL3iGyoDo" qs="1" brand="0"></matterport-viewer>
```

If a URL param is camelCase, switch it to kebab-case:

```html
<!-- `applicationKey` becomes `application-key` -->
<matterport-viewer m="SxQL3iGyoDo" application-key="YOUR_APPLICATION_KEY"></matterport-viewer>
```

For users familiar with the [bundle](https://matterport.github.io/developer-docs/bundle-sdk/) that required an iframe, you can  use a `src` attribute and provide the same URL that you would for that iframe:


```html
<!-- using the full URL or path will work: -->
<matterport-viewer src="/bundle/showcase.html?m=SxQL3iGyoDo&applicationKey=YOUR_APPLICATION_KEY"></matterport-viewer>

<!-- as will using just the query string: -->
<matterport-viewer src="m=SxQL3iGyoDo&applicationKey=YOUR_APPLICATION_KEY"></matterport-viewer>
```

(Note that in the first method with the full path, nothing is actually loaded from `/bundle/showcase.html` - anything that isn't the query string is ignored. The full path is allowed to support easy transition from `<iframe>` to `<matterport-viewer>` components.)
## Caveats

### Workspaces

In projects with Yarn workspaces, it may be helpful to mark the SDK package as `nohoist` if you run into issues with `yarn matterport-assets` copying the assets correctly. For example:

In my project, I have two workspaces, `a` and `b`. Both use the `@matterport/webcomponent` package.

**Problem:** Installing in both locations would hoist `@matterport/webcomponent` to the root directory, and `yarn workspace a matterport-assets` may run into issues.

**Solution:** In my root directory's `package.json`, I add the following:

```
...
  "workspaces": [
    ...,
    "nohoist": [
      "**/@matterport/webcomponent"
      ...
    ]
  ]
...
```

I then delete all `node_modules` folders in my project and reinstall with `yarn install`. From there, I can run `yarn workspace a matterport-assets public` and see the assets copied to `packages/a/public`.

---
_Source: https://npm.io/package/@matterport/webcomponent · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
