Users
- 1 minute to read
The Design Editor only deals with login sessions once. It needs a way to differentiate uploaded files and personalized products so that a user does not have access to content belonging to someone else. To get around this, the website has to initialize the Design Editor with a unique user identifier. The web-to-print editor should associate personalized products with the same user identifier to specify that they were created by the corresponding user. If the user uploads photos to the image gallery when personalizing a print product during the first session, the photos will be available to the user when they return to the website and create another order.
E-commerce platforms always identify user accounts registered in the system by a unique identifier. When integrating the Design Editor, you will need to find the technical documentation for your platform and look up information on how to retrieve the identifier using the platform's API.
In some scenarios, it may be more beneficial to create an identifier for yourself in the code initializing the Design Editor on the website, store it in a custom user attribute in the e-commerce system, and then pass it to the editor. Next time the editor signs in, the code will check if the attribute is already filled with a value and, if so, retrieve and use it as the user's identifier in the Design Editor.
In order to initialize the editor with a user identifier, you should pass it to the loadEditor() method as a part of the editor configuration.
var configuration = {
userId: "e02e4ced-b56e-caee-4e88-a2482976db73"
};
CustomersCanvas.IframeApi.loadEditor(iframe, product, configuration);
When a user identifier is not specified, the default value is used. To change the default user identifier, use the DefaultUserId
parameter in AppSettings.config.