@empathyco/x-components
Version:
Empathy X Components
25 lines (16 loc) • 1.39 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [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
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [addProductToCart](./x-components.xapi.addproducttocart.md) | | (productId?: string) => void | To track that a product was added to the cart from PDP. |
| [getSnippetConfig](./x-components.xapi.getsnippetconfig.md) | | () => [SnippetConfig](./x-components.snippetconfig.md) | To get the snippet config object. |
| [init](./x-components.xapi.init.md) | | (config: [SnippetConfig](./x-components.snippetconfig.md)<!-- -->) => Promise<void> | Method to initialize the XComponents app. |
| [search](./x-components.xapi.search.md) | | (query?: string) => void | Dispatch a search with the query parameter. |
| [setSnippetConfig](./x-components.xapi.setsnippetconfig.md) | | (config: Partial<[SnippetConfig](./x-components.snippetconfig.md)<!-- -->>) => void | To set or update any property of the [SnippetConfig](./x-components.snippetconfig.md)<!-- -->. |