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

trillion-viewer

Package Overview
Dependencies
Maintainers
2
Versions
288
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trillion-viewer

Trillion 3D Viewer

  • 0.4.7
  • npm
  • Socket score

Version published
Weekly downloads
527
decreased by-4.7%
Maintainers
2
Weekly downloads
 
Created
Source

Trillion Viewer

This is Trillion Viewer that allow you to integrate Trillion SDK in your site. For more information please visit https://trillion.jewelry

Installing

Using npm:

npm install trillion-viewer

Using yarn:

yarn add trillion-viewer

How to use:

You need to create an empty div element for viewer initialization. For example:

 <div id="trillion-viewer"></div>

Then, in your js code:

import {TrillionViewerApp} from "trillion-viewer"

const elem = document.getElementById('trillion-viewer')
const trillionViewer = new TrillionViewerApp()
trillionViewer.init(elem)
trillionViewer.setJewelryID('demo-ring')
trillionViewer.refresh()

For typescript:

const elem = document.getElementById('trillion-viewer') as HTMLElement

Instance methods

trillionViewer#init() - Create viewer on the provided HTML element
trillionViewer#refresh() - reload viewer after changing parameters
trillionViewer#setJewelryID(sku) - Set the id(SKU) of the jewelry to load
trillionViewer#getJewelryID() - Get the id(SKU) of the uploaded jewelry

Using CDN to get Trillion Viewer

use this pattern: unpkg.com/:package@:version/:file

For example:

import {TrillionViewerApp} from "https://unpkg.com/trillion-viewer@0.2.17/build-lib/trillion-viewer.js"

React component

This library also provides the React component for widget.

How to use

import component:

import { TrillionViewer } from "trillion-viewer";

use somewhere in your React application:

function MyComponent() {
  return (
    <div className="MyComponent">
        <TrillionViewer jewelryId={'demo-ring'}/>
    </div>
  )
}

Keywords

FAQs

Package last updated on 23 Dec 2022

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