<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [XAPI](./x-components.xapi.md)

## XAPI interface

Interface with the API functions exposes as X [window](https://developer.mozilla.org/en-US/docs/Web/API/Window) property.

**Signature:**

```typescript
export interface XAPI 
```

## Methods

|  Method | Description |
|  --- | --- |
|  [addProductToCart(productId)](./x-components.xapi.addproducttocart.md) | To track that a product was added to the cart from PDP. |
|  [getSnippetConfig()](./x-components.xapi.getsnippetconfig.md) | To get the snippet config object. |
|  [init(config)](./x-components.xapi.init.md) | Method to initialize the XComponents app. |
|  [search(query)](./x-components.xapi.search.md) | Dispatch a search with the query parameter. |
|  [setSnippetConfig(config)](./x-components.xapi.setsnippetconfig.md) | To set or update any property of the [SnippetConfig](./x-components.snippetconfig.md)<!-- -->. |

