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

@acuityai/acuityai

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@acuityai/acuityai

The acuityai SDK is library that uses https://acuityai.com com for implement shoppable in video element by utilizing our easy interface.

  • 1.0.11
  • npm
  • Socket score

Version published
Weekly downloads
21
increased by10.53%
Maintainers
1
Weekly downloads
 
Created
Source

AcuityAi SDK

The acuityai SDK is library that uses https://acuityai.com for implement shoppable in video element by utilizing our easy interface.

Get started

Installing

Import our script into the exists application

import acuityai from 'acuityai';

You can import it globally direct into the scripts tags

<script src="https://assets.acuityai.com/acuity-layer.js"></script>
<script>
	acuityaiLayer.start(...)
</script>

Connecting the video into the interface

acuityai.start(config);

Config

propertytypedescription
selectorstringrequiredhere you can pass the selector for the shoppable interface know where it should place the product panel
cartButtonSelectorstringoptionalhere you can pass the selector for the cart button be placed inside, you can also create your on button using events and actions.
companystringrequiredname of the company created on the https://customer.acuityai.com
videoelementoptionalvideo element using the video element we are able to track, time, and dispatch actions like pause and play. If you don't want to pass the video element you can sync the product tray using setProgress.
assetstringrequiredthis is the asset id that you can get from the https://customer.acuityai.com of the related video asset

Example

acuityai.start({
    selector: '#shoppable-layer',
    cartButtonSelector: '#shoppable-btn-cart',
    company: 'company',
    video: document.querySelector('#video'),
    asset: 'myvideo-123'
});

Events

Cart total

cart updates every-time a product is added or remove from the cart

acuityai.events.on('cartTotal', total => {
	console.log(total);
});

Open product

trigger every time a product is opened

acuityai.events.on('openProduct', () => {
	console.log('openProduct');
});

Close product

trigger every time a product is closed

acuityai.events.on('closeProduct', () => {
	console.log('closeProduct');
});

Actions

Open/Close Cart

This method enables you to open/close the cart

acuityai.toggleCart();

Set video progress

Enables the progress of the video. This is used to sync our product tray with the video time line. When a video element is informed on the start method, set progress is not required.

acuityai.setProgress({ duration, currentTime });

Destroy

This method enables the destruction fo all the elements created on start

acuityai.destroy();

FAQs

Package last updated on 05 May 2021

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