Web API References
Initialization Method
To get started, call the GlamAR.init method. This adds the GlamAR SDK into the target container and configures it with the provided Access key and optional configuration.
GlamAR.init(containerId, apiKey, payload);
Initialization Payload
| Name | Type | Description |
|---|---|---|
| platform | string | Platform you're targeting (e.g. web) |
| category | string | Supports lots of categories |
| configuration | ConfigurationOptions | Initialization configuration object |
Following are all the configuration options that can passed under thepayload object.
Subcategories defined in overview section can be passed in the category parameter.
ConfigurationOptions
| Name | Type | Description |
|---|---|---|
| skinAnalysis | SkinAnalysisOptions | Options regarding skin anaylysis |
SkinAnalysisOptions
| Name | Type | Description |
|---|---|---|
| appId | string | Skin analysis application ID |
Basic Example
GlamAR.init("containerId", "accessKey", {
"platform": "web",
"category": "skinanalysis",
"configuration": {
"skinAnalysis": {
"appId": "your_app_id"
}
}
});
Post-Initialization Methods
addEventListener
GlamAR.addEventListener(eventName, handlerFunction);
Adds the listener to the given event name.
Return Value: None
| Parameters | Type | Description |
|---|---|---|
| eventName | string | A Name of specific event or "*" To listen to the all the events. |
| handlerFunction | function | Your handler function that will listen to callback. |
removeEventListener
GlamAR.removeEventListener(eventName, handlerFunction);
Removes the given listener for the event name.
Return Value: None
| Parameters | Type | Description |
|---|---|---|
| eventName | string | A Name of specific event or "*" To remove all the events. |
| handlerFunction | function | Your handler function that will listen to callback. |
isLoaded
GlamAR.isLoaded();
Returns the status of module loading.
Return Value:trueif loaded, otherwisefalse
| Parameters | Description |
|---|---|
None | No parameters required. |
skinAnalysis
GlamAR.skinAnalysis();
Opens the Skin Analysis flow.
Return Value: None
| Parameters | Description | Type | Options |
|---|---|---|---|
| options | Pass start (Required) | string | start |
reset
GlamAR.reset();
Removes all the current effects from the canvas.
Return Value: None
| Parameters | Description |
|---|---|
None | No parameters required. |
close
GlamAR.close();
Closes canvas and returns to the main widget page.
Return Value: None
| Parameters | Description |
|---|---|
None | No parameters required. |
snapshot
GlamAR.snapshot();
After a successfully scan, client can be get a PDF of his scan from
shareevent
Return Value: none
| Parameters | Description |
|---|---|
None | No parameters required. |
back
GlamAR.back();
To simulate back button without using UI
Return Value: None
| Parameters | Description |
|---|---|
| None | No parameters required. |
Events
Check Events Page for event details.