Welcome to the cieblinkSDK module! This module allows customers to embed different functionalities of the Cieblink website directly in a frame that will allow them to communicate between their website and Cieblink.
Getting started with the cieblinkSDK module is incredibly easy. All you need to do is include the cieblink-sdk.js script in your HTML file by adding the following line to the
section of your document:<script src="https://sdk.ciemetric.com/sdk/cieblink-sdk.js"></script>
Once you've included the cieblink-sdk.js script in your HTML file, you'll have access to all the methods provided by the cieblinkSDK global object. This will allow you to interact with the Cieblink website directly from your own website and to access all the features provided by the cieblinkSDK module.
The `cieblinkSDK` global variable is the object that you will use to interact with the Cieblink SDK module. This object contains all of the methods and properties that you will need to use the module and configure your products and recipes.
The OpenProductConfiguration method is used to configure a cabinet or product using the Cieblink website. To use this method, you'll need to use the OpenProductConfiguration method from the cieblinkSDK module. Here's an example of how to use this method:
cieblinkSDK.OpenProductConfiguration({
key: "cieblinkTest",
cabinet: cabinet,
ref_type: "order",
ref_id: "123456",
onSave: (recipe) => {
//doSomething(recipe)
}
}).render('#element');
Following the initialization of the recipe configurator, it is important to call the render() method, otherwise the element will not render.
Here below are the different props the method can use :
env: string [ "dev" | "lab" | "production"];
key: string;
ref_type: string;
ref_id: string;
dimensions (optional) : object;
recipe: object;
onSave: (optionsRecipe : string) => void;
env: string [ "dev" | "lab" | "production"];
- The environment in which the configurator will be opened. It can be set to "dev", "lab" or "production". The default value is "lab".key: string;
- The key to identify the seller being used.ref_type: string;
- The type of reference which is either a quotation or an order.ref_id: string;
- The ID of this order or quotation.dimensions (optional): object;
- An optional object containing the width and height of the configuration window.
{ height : "300px", width : "300px" }
recipe: object;
- The object representing the recipe configuration, must contain a room_id.onSave: (optionsRecipe: string) => void;
- A callback function that is called when the user saves the recipe configuration. The function the returned value of the cabinet by Cieblink.The OpenRecipeConfiguration method is used to configure a recipe using the Cieblink website. To use this method, you'll need to use the OpenRecipeConfiguration method from the cieblinkSDK module. Here's an example of how to use this method:
cieblinkSDK.OpenRecipeConfiguration({
key: "cieblinkTest",
recipe: recipe,
ref_type: "order",
ref_id: "123456",
onSave: (recipe) => {
//doSomething(recipe)
}
}).render('#element');
Following the initialization of the recipe configurator, it is important to call the render() method, otherwise the element will not render.
Here below are the different props the method can use :
env: string [ "dev" | "lab" | "production"];
key: string;
ref_type: string;
ref_id: string;
dimensions (optional) : object;
recipe: object;
onSave: (optionsRecipe : string) => void;
env: string [ "dev" | "lab" | "production"];
- The environment in which the configurator will be opened. It can be set to "dev", "lab" or "production". The default value is "lab".key: string;
- The key to identify the seller being used.ref_type: string;
- The type of reference which is either a quotation or an order.ref_id: string;
- The ID of this order or quotation.dimensions (optional): object;
- An optional object containing the width and height of the configuration window.
{ height : "300px", width : "300px" }
recipe: object;
- The object representing the recipe configuration, must contain a room_id.onSave: (optionsRecipe: string) => void;
- A callback function that is called when the user saves the recipe configuration. The function the returned value of the recipe by Cieblink.