---
title: "Lookfy JavaScript API Documentation"
description: "Lookfy JavaScript API: Comprehensive Guide for Integration and Customization"
url: https://help.lookfy.app/en/articles/17-lookfy-javascript-api-documentation
collection: "Apps integration"
updated: 2026-08-05
language: en
---

# Lookfy JavaScript API Documentation

Lookfy JavaScript API: Comprehensive Guide for Integration and Customization

## **What is the Lookfy JavaScript API?**

JavaScript API documentation explains how to use various JavaScript events and methods in Shopify shops, which have the Lookfy app installed.

## **When the Lookfy app gets loaded**

When the Lookfy app gets loaded, Lookfy automatically triggers the **_lookfyLoaded_** event.  
Here is how you can configure a listener for said event:

```js
// This event will be fired whenever the Lookfy app is loaded
document.addEventListener('lookfyLoaded', function(event) {
    // Do your magic :) 
});

```

## **This event will be fired whenever a gallery is rendered**

When the Lookfy app gets created, Lookfy automatically triggers the **_lookfyGallery_** event.  
Here is how you can configure a listener for said event:

```js
// This event will be fired whenever the Lookfy app is created
document.addEventListener('lookfyGallery', function(event) {
    // Do your magic :) 
    const {galleryData, galleryElement} = event.detail;
});

```

## **When product is added to the cart from the Lookfy**

When After the product gets added to the cart, our Lookfy app automatically triggers the following _lookfyCartAdded_ event.  
Here is how this event is triggered:

```js
// This is how the event is triggered
document.dispatchEvent(new CustomEvent("lookfyCartAdded", { 
	detail: {
		cartDetail: response, 
		form: form, 
		cart: cart, 
		formID: formID
	}
}));

```

And here is how you can configure a listener for said event:

```js
// This is how you can configure a listener for said event
document.addEventListener('lookfyCartAdded', function(event) {
    // Do your magic :) 
});
```
