Image Upload

Apply uploaded images to items for personalization

📘

Please Note

There is an existing REST API that will also allow you to upload images for personalization, this player API is a much more performant route for jpeg/png images.

Image Upload

This API is a streamlined way for you to take in uploaded images and apply them to the product in your Threekit configurator. All you need to do is call the uploadImage method, which will return an assetId. You can apply this to a configuration just like any asset/part-reference:

await player.uploadImage(file); // 5fd605e4-6c50-467d-8683-74700e2a43fe

Example

var input = document.getElementById('input'); // assuming input type is file
input.onchange = async e => {
  const file = e.target.files[0];
  const assetId = await player.uploadImage(file);
  configurator.setConfiguration({ Image: { assetId } });
}