The public SDK for RIPE Core written in vanilla ECMAScript v6.
As a starting point, you need to provide the
model of your customizable product.
You may also pass an
options map to override parameters like the base
url of the server where the product is configured, as well as
country, which are 'EUR' and 'US' respectively by default.
var ripe =brand: brandmodel: modelvariant: varianturl: urlcurrency: currencycountry: countrydku: dku;
After initializing the Ripe object you should subscribe to the available events so you can easily respond and update your UI.
Triggered when all of the async operations related with the instance setup are complete.
Triggered whenever there is a customization change (eg: the color of a part is changed).
Notifies you when the price of the customization changes.
Called when a new model configuration has been loaded. You should use this to explore the model's configuration data, ie: when populating the customization options on your UI.
Called when the possible customization combinations of the product are loaded. Each combination is a triplet formed by
Notifies you when all the product's parts have changed.
You can also be notified when a part is selected.
Triggered whenever there is a frame change.
3. Product visualization
Usually the product has 24 lateral frames, plus a top and bottom view.
To display any frame of the product you can use the
bindImage function to automatically update an
<img> element. This method also contains an
Subscribe to the event
loaded and you will know when your image is loaded.
Finally, after the initial binding of the frames you should call the
load function for the initial update.
var element = documentvar image = ripe;image;ripe;
Whenever you want to set a new image frame, you only have to call
4. Product customization
You can change a part of your product by using the
Alternatively, multiple parts can be changed at once with
To undo part changes in the product you can call the
undo function. The method
canUndo is also available so you can allow the undo operation based on the current changes. To reverse an
undo operation you can use the
if riperipe;if riperipe;
If you need to explicitly retrieve the product's customization information you can use the following methods:
getConfig: to get information about the product's model.
getCombinations: to get all the customization options for products without any restrictions applied.
getDefaults: to get the product's default customization.
getFrames: to get all the product's frames.
getPrice: to get the product's pricing information.
getFactory: to get the factory information where the model is made, specifically its name and the estimated production time in days.
These functions receive a callback function as a parameter as shown below:
5. Product personalization
To display a frame with initials you can use the bindImage function by setting the parameter
true on the options map.
The initials are set on the
Ripe object with the
setInitials function which accepts
engraving as parameters.
If your initials require a transformation to different profiles you can set a function that receives the
engraving parameters and transforms it into a map with initials and an array of profiles using the
6. Product interaction
To provide an interactive product visualization you simply need to pass a
<div> element to the method
Subscribe to the event
loaded and you will know when your configurator is loaded.
This element supports the following methods:
||displays a new frame, with an animation from the starting frame|
||highlights a product's part|
||removes any highlight from the product|
||selects a given product's part|
||removes selection from a given product's part|
This element supports the following events:
||Triggered upon first loading of the model's internal frame structure (once per model load)|
||Triggered when the configurator finishes loading all of the internal frames, and is ready for interaction (once per part setting)|
||Raises whenever there's a rotation in the configurator viewport (viewable frame has changed)|
var element = document;var configurator = ripe;configurator;
If your product has synchronization rules, where a set of parts must always have the same material and color, you can use the
sync plugin to have this behavior automatically. To do this you need to initialize the
SyncPlugin which receives the synchronization rules and add it to the ripe object using the
addPlugin function. When a new part is set, the plugin checks the synchronization rules and automatically makes the necessary changes to the related parts.
To include restrictions to the customization experience the
Restrictions plugin is available. This allow setting rules that declare that certain combinations between different parts, materials or colors are not possible. When a new option is selected, the plugin will check if any of the other parts has become restricted by the new part and change them to a valid option automatically. The usage of this plugin is similar to the
To be notified when a restriction causes parts to be changed, bind to the
restrictions event on the plugin object. Whenever the restrictions are applied, this event will be triggered with the changes that ocurred and the part that caused them.
If you need to create an order using the
ripe-core API then you have to set the size of the product according to the
ripe-core native scale. The following methods allow you to convert from and to that scale.
scale is a string that represents the size scale,
value is the numeric value in that scale and
gender is a string that can be set to
To reduce the number of requests when you need to convert several size options you can use the bulk methods that accept an array of values and return an array with all the results.
sizeToNative(scale, value, gender)
nativeToSize(scale, value, gender)
sizeToNativeB(scales, values, genders)
nativeToSizeB(scales, values, genders)
When using API methods that require special permissions you can use the following methods to authenticate your application:
auth(username, password, callback), for login with username and password, or OAuth authentication with
||string||RGB format color value of the background ( no need to pass the "#" signal ). No background by default. Example: "cccccc".|
||string||Two letters standard country codes defined in ISO 3166-1 alpha-2 codes. "US" by default. Example: "PT".|
||string||Standard currency codes defined in ISO 4217 codes. "USD" by default. Example: "EUR".|
||array of strings||All the frames to be used in the customization. Example: ["top", "bottom", "1", "2"].|
||string||One of the valid image formats: 'lossless', 'lossful', 'jpeg', 'webp', 'sgi' or 'png'. "png" by default.|
||number||Specifies how many milliseconds the mask animation takes to complete. 150 by default.|
||number||Specifies the opacity value of the the masks used to highlight/select parts. 0.4 by default.|
||number||Maximum value for frame image size. 1000px by default.|
||boolean||Defines if the combinations are loaded or not. False (loading) by default.|
||boolean||Defines if the defaults are loaded or not. False (loading) by default.|
||boolean||Used to negate the
||boolean||Used to negate the
||JSON Object||Defines the product initial parts. Each key is a part's name built with color and material information. Example:
||boolean||Activates the remote calls functionality executed by several workflows. True by default.|
||boolean||Activates the remote execution of the model's logic on config updates. True by default.|
||boolean||Activates the remote execution of the model's logic on parts updates. True by default.|
||boolean||Activates the remote execution of the model's logic on initials updates. True by default.|
||string||Defines the degree of sensitivity of the dragging interaction. 40 by default.|
||number||Initial size value of a frame image that is going to be composed. By default it's 1000px.|
||string||Variant of the customizable product.|
||string||The version of the build of the customizable product.|
||boolean||Determines if a chain based loading should be used for the pre-loading process of the various image resources to be loaded. False by default.|
||boolean||Enables masks on selection/highlight. True by default.|
||boolean||Enables the fetch price feature every time a new part is set. True by default.|
||boolean||Enables the part synchronization feature. False by default.|
- ≥ Chrome v23 (V8)
- ≥ Firefox v21 (SpiderMonkey)
- ≥ Safari v6 (Nitro)
- ≥ Opera v12 (V8)
- ≥ IE v11 (Chakra)
- ≥ Android 4.4
- ≥ iOS's WebKit 9
For API reference documentation follow ripe-sdk-docs.platforme.com.
RIPE SDK is currently licensed under the Apache License, Version 2.0.