Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-amplify/xr

Package Overview
Dependencies
Maintainers
11
Versions
1300
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-amplify/xr

XR category of aws-amplify

  • 4.0.15
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
166K
decreased by-3.29%
Maintainers
11
Weekly downloads
 
Created

What is @aws-amplify/xr?

@aws-amplify/xr is a package that provides tools for integrating augmented reality (AR) and virtual reality (VR) experiences into web and mobile applications using AWS Amplify. It simplifies the process of adding immersive experiences by leveraging AWS services.

What are @aws-amplify/xr's main functionalities?

Scene Management

This feature allows you to load and manage AR/VR scenes. The code sample demonstrates how to load a scene by specifying the scene name and the DOM element where the scene should be rendered. It also includes a progress callback to monitor the loading progress.

import { XR } from '@aws-amplify/xr';

XR.loadScene('sceneName', 'domElementId', {
  progressCallback: (progress) => {
    console.log(`Loading progress: ${progress}%`);
  }
}).then(() => {
  console.log('Scene loaded successfully');
}).catch((err) => {
  console.error('Error loading scene', err);
});

Object Placement

This feature allows you to place objects within the AR/VR scene. The code sample demonstrates how to add an object by specifying its name, position, and scale.

import { XR } from '@aws-amplify/xr';

XR.addObject('objectName', {
  position: { x: 0, y: 0, z: 0 },
  scale: { x: 1, y: 1, z: 1 }
}).then(() => {
  console.log('Object added successfully');
}).catch((err) => {
  console.error('Error adding object', err);
});

Event Handling

This feature allows you to handle events within the AR/VR scene. The code sample demonstrates how to set up an event listener for a 'tap' event, which logs the event details when an object is tapped.

import { XR } from '@aws-amplify/xr';

XR.on('tap', (event) => {
  console.log('Object tapped', event);
});

Other packages similar to @aws-amplify/xr

FAQs

Package last updated on 16 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc