Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
shopar-plugin
Advanced tools
Plugin for the Web that seamlessly integrates into your webpage to create embedded virtual try-on and 3D preview capabilities.
Plugin for the Web that seamlessly integrates into your webpage to create embedded virtual try-on and 3D preview capabilities.
Powered and developed by DeepAR.
Create an account in the ShopAR Dashboard.
Add some models to your account. Make sure the models' plugin SKUs match the product IDs on your website.
There are two distinct ways of integrating the plugin: via Script tag and via NPM.
Add the following script to your HTML.
<script src="https://cdn.jsdelivr.net/npm/shopar-plugin@0.8.0/dist/shopar-plugin.js"></script>
It is possible to use a different CDN instead of jsDelivr (e.g. cdnjs, unpkg), or even a relative path if the plugin is distributed as a static asset to your app. Just make sure to set the baseUrl
parameter accordingly (see setup options for more details).
Add shopar-plugin
to your project:
npm install shopar-plugin
# or
yarn add shopar-plugin
Paste the following snippet in your HTML.
<script>
ShopAR.plugin.setup({
apiKey: 'API_KEY',
sku: 'PRODUCT_ID',
targetElement: 'TARGET_ELEMENT',
});
</script>
API_KEY
with your API key. You can find it in the ShopAR Dashboard.PRODUCT_ID
with the ID of the product. Make sure it matches the plugin SKU of the model in the ShopAR Dashboard.TARGET_ELEMENT
with the HTML element you wish to embed the plugin's UI into.To change the look-and-feel of the plugin's UI, modify the following CSS classes:
.shopar-btn-container {
/* Container for the control buttons. */
}
.shopar-btn {
/* Control button. */
}
.shopar-btn:hover {
/* Hovered control button. */
}
.shopar-loading-container {
/* Container for the loading screen. */
}
.shopar-loading-text {
/* Loading text. */
}
.shopar-loading-bar-bg {
/* Loading bar's background. */
}
.shopar-loading-bar-fg {
/* Loading bar's foreground. */
}
.shopar-loading-bar-fg.active {
/* Loading bar's foreground when active. */
}
.shopar-qr {
/* Container for the QR code. */
}
.shopar-ar-prompt {
/* Container for the AR prompt. */
}
.shopar-ar-prompt-text {
/* AR prompt text. */
}
.shopar-ar-prompt-img {
/* AR prompt image. */
}
Alternatively, use your own UI:
const shopAR = await ShopAR.plugin.setup({
// ...
defaultUI: false,
});
myARButton.onclick = shopAR.launchAR;
myARButton.disabled = shopAR.launchAR === undefined;
my3DButton.onclick = shopAR.launch3D;
myARButton.disabled = shopAR.launch3D === undefined;
myCloseARButton.onclick = shopAR.closeAR;
myCloseARButton.disabled = shopAR.closeAR === undefined;
myClose3DButton.onclick = shopAR.close3D;
myClose3DButton.disabled = shopAR.close3D === undefined;
// or just:
myCloseButton.onclick = shopAR.close;
myCloseButton.disabled = shopAR.close === undefined;
If you wish to change the SKU or target element at runtime, simply call setup()
with different parameters.
This method fetches the specified product from the ShopAR Dashboard and renders the plugin's UI.
Options used for the plugin setup:
apiKey
string
sku
string
targetElement
HTMLElement
static
or relative
.initialState
(optional)
'AR' | '3D'
baseUrl
(optional)
string
https://cdn.jsdelivr.net/npm/shopar-plugin@0.8.0/dist
defaultUI
(optional)
boolean
false
, disables the default UI such as buttons, loading and error views.true
interactive
(optional)
boolean
false
, disables user interactivity by ignoring input events.true
zoomEnabled
(optional)
boolean
false
, disables zoom in 3D by ignoring mouse scroll or pinch touch events.true
alwaysTransparentBackground
(optional)
boolean
true
, transparent background will always be used in 3D.initialAnimation
(optional)
string
or KeyFrameConfig[]
strings
(optional)
object
loading.ar
: Loading Try On...
loading.3d
: Loading 3D...
Please see: https://developer.deepar.ai/customer-agreement
FAQs
Plugin for the Web that seamlessly integrates into your webpage to create embedded virtual try-on and 3D preview capabilities.
The npm package shopar-plugin receives a total of 31 weekly downloads. As such, shopar-plugin popularity was classified as not popular.
We found that shopar-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.