Socket
Socket
Sign inDemoInstall

trillion-widget

Package Overview
Dependencies
11
Maintainers
2
Versions
221
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

trillion-widget

Trillion AR Widget Source


Version published
Weekly downloads
940
increased by204.21%
Maintainers
2
Created
Weekly downloads
 

Readme

Source

Trillion AR Widget

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

Installing

Using npm:

npm install trillion-widget --save

Using yarn:

yarn add trillion-widget

How to use:

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

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

Then, in your js code:

import {TrillionWidgetApp} from "trillion-widget"

const elem = document.getElementById('trillion-widget')
const trillionWidget = new TrillionWidgetApp(elem)
trillionWidget.setJewelryID('demo-pendant-ar')
trillionWidget.setJewelryType('necklace')
trillionWidget.refresh()

For typescript:

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

Instance methods

twa#refresh() - reload widget after changing parameters
twa#setJewelryID(sku) - Set the id(SKU) of the jewelry to load
twa#getJewelryID() - Get the id(SKU) of the uploaded jewelry
twa#setIsVisible(isVisible) - Set widget visible
twa#getIsVisible() - Get widget visible
twa#setJewelryType(type) - Set the jewelry type (earrings, ring, necklace) to load
twa#getJewelryType() - Get the uploaded jewelry type
twa#setUsePerformanceCheck(use) - use performance check
twa#getUsePerformanceCheck() - use performance check

Using CDN to get Trillion Widget

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

For example:

import {TrillionWidgetApp} from "https://unpkg.com/trillion-widget@0.2.8/build-lib/trillion-widget.js"

Keywords

FAQs

Last updated on 06 Sep 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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc