
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-virtual-tryon
Advanced tools
The Virtual Try-On React Component Library enables developers to integrate AI-powered virtual try-on features into their web applications. This guide will walk you through the setup, registration, and usage of the library.
Before using the Virtual Try-On components, you must register your application on aiframe.app to obtain an API Key and Auth Token.
You will be redirected to the Developer Settings page. Click on the "Register App" button to open a popover.
In the popover, provide the following details:
http://yourdomain.com or https://yourdomain.com).
Once the details are provided, click the "Register" button to complete the process.
Upon successful registration:
To use the Virtual Try-On components, wrap your application with the TryOnProvider, passing in your API Key and Auth Token.
First, install the package via npm or yarn:
npm install react-virtual-tryon
# or
yarn add react-virtual-tryon
Wrap your application with the TryOnProvider in your main component (e.g., App.tsx or layout.tsx for Next.js):
"use client";
import { TryOnProvider } from "react-virtual-tryon";
import ProductPage from "./ProductPage";
function App() {
return (
<TryOnProvider apiKey="your-api-key" token="your-auth-token">
<ProductPage />
</TryOnProvider>
);
}
export default App;
TryOnProvider ensures that the API Key and Auth Token are available throughout the library.Once the provider is set up, users can integrate the TryOnButton component into their product pages.
| Prop Name | Type | Required | Description |
|---|---|---|---|
dressId | string | ✅ | The unique identifier for the dress. |
dressImage | string | ✅ | URL of the dress image. |
dressName | string | ✅ | Name of the dress. |
className | string | ❌ (optional) | Custom styling for the button. |
children | any | ❌ (optional) | Custom text inside the button (e.g., Try On). |
widgetClasses | string | ❌ (optional) | Custom styling for the Virtual Fitting Room modal. |
import { TryOnButton } from "react-virtual-tryon";
const ProductPage = () => {
const product = {
id: "dress123",
image: "https://example.com/dress.jpg",
name: "Elegant Red Dress",
};
return (
<div>
<h1>{product.name}</h1>
<img src={product.image} alt={product.name} />
<TryOnButton
dressId={product.id}
dressImage={product.image}
dressName={product.name}
className="custom-button-style"
>
Try On
</TryOnButton>
</div>
);
};
export default ProductPage;
className prop allows developers to style the button to match their app theme.children prop lets users customize the button text (e.g., "Try On").To ensure proper styling of the Virtual Try-On components, importing the library's CSS file is mandatory.
Add the following import to your entry file (index.js, index.tsx, or layout.tsx in Next.js):
import "react-virtual-tryon/dist/index.css";
Once imported, the component will have default styles applied.
<TryOnButton
dressId="dress123"
dressImage="https://example.com/dress.jpg"
dressName="Elegant Red Dress"
>
Try It On
</TryOnButton>
✔ Default styles will now be applied automatically.
For projects that require additional customization, developers can override the default styles using their own CSS.
/* styles.css */
.tryon-button {
background-color: #ff5733;
color: white;
padding: 10px 16px;
border-radius: 6px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: background-color 0.3s ease;
}
.tryon-button:hover {
background-color: #e04b2c;
}
Apply the styles using the className prop:
<TryOnButton className="tryon-button">Try It On</TryOnButton>
| Requirement | Action |
|---|---|
| Import Required | The stylesheet must be imported: import "react-virtual-tryon/dist/index.css". |
| Custom Styling | Use className to apply additional styles as needed. |
By following these guidelines, you can ensure seamless integration while maintaining design consistency.
FAQs
## **Introduction**
We found that react-virtual-tryon demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.