npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@matterport/sdk

v1.4.24

Published

Matterport SDK and SDK utilities.

Downloads

1,455

Readme

The Matterport 3D Showcase SDK is a javascript library for third-party developers to integrate Matterport with their web applications. Developers can deeply customize the 3D Showcase experience and build entire applications off of Matterport, enabling many exciting new use cases.

See full documentation for the SDK here.

Installation

⚠️ Make sure to obtain an SDK key before installing. ⚠️

Starter packages

See this repo for examples in several JS frameworks and vanilla JS.

Existing projects

You can also add the package to your existing project, or to a freshly-initialized npm/yarn project:

  1. npm install @matterport/sdk or yarn add @matterport/sdk.
  2. In your code:
import { setupSdk } from '@matterport/sdk'

const mpSdk = await setupSdk('YOUR_SDK_KEY')
// or, for a specific public space
const mpSdk = await setupSdk('YOUR_SDK_KEY',  { space: 'YOUR_SPACE_ID' })`
  1. Use mpSdk to interact with your Matterport space (see documentation here). For example:
const mpSdk = await setupSdk('YOUR_SDK_KEY')

// commands
mpSdk.Tour.start()
// observables
mpSdk.Camera.pose.subscribe(pose => { /* ... */ })
// etc

Options

You can pass an object with SDK options as the second argument of setupSdk. Allowed properties and their defaults:

const options = {
  /**
   * Array of options to pass on SDK connection.
   * Anything from sdk.connect will work here.
   */
  connectOptions: [],

  /**
   * The element or selector that will attach the created iframe.
   * Defaults to document.body if not specified.
   * Ignored if the `iframe` option is provided.
   */
  container: undefined,

  /**
   * The domain to connect to. Defaults to `my.matterport.com`.
   */
  domain: 'my.matterport.com',

  /**
   * The element or selector to use as the iframe for space display.
   * Creates a new iframe if falsy. Default `undefined`.
   */
  iframe: undefined,

  /**
   * The options to pass to the iframe, as an object of
   * attribute keys and values.
   *
   * { width: '500px', height: '500px' }
   * creates: <iframe width="500px" height="500px">
   * ```
   */
  iframeAttributes: {},

  /**
   * The query params to include in the iframe's `src` URL. See 
   * https://support.matterport.com/s/article/URL-Parameters
   * for a full list.
   *
   * Do not specify the `m` param in these params - 
   * use the `space` option instead.
   *
   * ```
   * { qs: 1 }
   * creates: <iframe src="...&qs=1">
   * ```
   */
  iframeQueryParams: {},

  /**
   * Space ID. Defaults to an example if not specified.
   */
  space: 'SxQL3iGyoDo',
}

const mpSdk = await setupSdk('YOUR_SDK_KEY', options)