Editor Integration Reference
Last updated
Was this helpful?
Last updated
Was this helpful?
Aidge Virtual Try-On enables clients to integrate try-on functionality into their own platforms by embedding the following features through an iframe:
Upload garment images
Choose your models
Generate model try-on images
Manage your design
Obtaining Methods
International Site:
Chinese Site:
Credentials
Obtaining Methods
Storage Requirements
Name
Aidge Console→ api-keys
Can be Passed Through the Frontend
Key
Aidge Console→ api-keys
Backend Storage, Strictly Prohibit Leakage
The client-side frontend component requests the client-side backend interface to obtain the parameters required by Aidge.
The client-side backend uses the signing method provided by Aidge to generate a signature and returns it along with other parameters to the client-side frontend.
The client-side frontend requests the iframe provided by Aidge using the parameter values obtained from the client-side backend.
When the client interacts with the Aidge page, there is an interface interaction between Aidge's frontend and backend.
The Aidge backend handles tasks like login verification. If verification fails or there is a prolonged period of inactivity, the client is prompted to re-login.
When Aidge's frontend needs to interact with the client's frontend, event interactions occur, such as requesting client confirmation for actions or prompting re-login.
The client obtains the Name and Secret provided by Aidge from the official Aidge platform. The client-side backend securely stores these credentials to generate encrypted signature fields and other parameters required by Aidge.
The client-side backend encapsulates an interface (e.g., an HTTP API) for its frontend to generate Aidge-compliant signatures. Using the Name and Secret obtained from Aidge, the backend leverages AidgeSignUtils to generate the required signature. It then returns the parameters (including the signature) to the client-side frontend.
The interface provided by the client-side backend to the client-side frontend must include the following fields in the response:
Parameter
Type
Required
Description
ak
string
Yes
ak applied by the user on the official website
sign
string
Yes
Signature (encrypted using AidgeSignUtils provided by Aidge)
userId
string
Yes
Business-Customized User ID
timeStamp
Long
Yes
Current Unix timestamp (in seconds, e.g., 1739779669 represents February 17, 2025, 16:07:49 UTC).
📢Note: The timeStamp value must remain consistent with the value passed when generating the signature!
Parameter
Parameter
Type
Required
Description
timeStamp
Long
Yes
Current Unix timestamp(in seconds).
📢Note: The timeStamp must not be ahead or behind; otherwise, the Aidge side will fail the verification and prompt that the login is invalid.
secret
String
Yes
The secret obtained from the Aidge official website.
📢Note: The client-side backend must ensure strict protection against data leakage.
userId
String
No
Client-Defined User ID (used to distinguish between different users within the client-side system).
The Aidge platform uses the userId parameter to implement the isolation and sharing of user data (such as generated "history" and used model images). Merchants can choose to pass different userId values or a single unified userId based on their business needs (not passing a userId or passing a fixed userId will have the same effect).
Response parameters:
Type
Description
String
The signed signature. It must be passed through to Aidge's iframe. Aidge will verify the signature; if verification fails, the user will be prompted to log in.
📢 If signature verification fails (including cases where the timeStamp is too far ahead or behind), a prompt indicating that the user is not logged in will be returned.
Signature code:
Basic Configuration Embed the iframe into your page:
URL Parameters
The iframe URL must include the following parameters:
Parameter
Type
Required
Description
ak
string
Yes
API key
sign
string
Yes
Sign
userId
string
Yes
User id
timeStamp
string
Yes
timeStamp
lang
string
No
Language Settings (Default: English)
en - English
cn - Chinese
ja - Japanese
iframe Events
Editor-Emitted Events
Event
Description
Data format
generateConfirm
Generate confirmation event
suitType-suitType
top-top
bottoms-bottoms
dresses-onepieces
suits-suits
url-original images
mask-RLE data after segment
maskArr-Select RLE data through the editor
modelList-model list
isRepaired-Whether to enable repair
refinedVersion-Enhanced repair version
1.0
1.5
save
After the user clicks Save, send the currently input garment images and generation result data.
resultImageId - result image id
resultImageUrl-result image url
originImageUrls-original images
notLogin
Not Logged In Prompt Event
noResource
Insufficient Resources Prompt Event
uploadImgUrl
URL After Image Upload
url-image oss
taskResult
Result Event
taskId-task id
status-task status
success-success
failed-failed
partiallyFailed-partiallyFailed
suitType-suitType
top-top
bottoms-bottoms
dresses-onepieces
suits-suits
url-original images
mask-RLE data after segment
maskArr-Select RLE data through the editor
modelList-model list
isRepaired-Whether to enable repair
refinedVersion-Enhanced repair version
1.0
1.5
plannedImageCount-planned generation image count
generatedImageCount-generated image count
planRefinerImageCount-Planned number of virtual try-on pro builds
generatedRefinerImageCount-Actual number of virtual try-on pro generated
planRepairImageCount-Planned number of hand and foot repairs to be generated
generatedRepairImageCount-Actual number of hand and foot repairs generated
result-res
ParentPageEventHandling
User page sends an event to the editor.
Event
Description
Data format
generateConfirm
Confirm the generated response.
For purchasing an AK on the international site:
For purchasing an AK on the Chinese site: