@empathyco/x-components
Version:
Empathy X Components
135 lines (59 loc) • 1.82 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
<table><thead><tr><th>
Property
</th><th>
Modifiers
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
[addProductToCart](./x-components.xapi.addproducttocart.md)
</td><td>
</td><td>
(productId?: string) => void
</td><td>
To track that a product was added to the cart from PDP.
</td></tr>
<tr><td>
[getSnippetConfig](./x-components.xapi.getsnippetconfig.md)
</td><td>
</td><td>
() => [SnippetConfig](./x-components.snippetconfig.md)
</td><td>
To get the snippet config object.
</td></tr>
<tr><td>
[init](./x-components.xapi.init.md)
</td><td>
</td><td>
(config: [SnippetConfig](./x-components.snippetconfig.md)<!-- -->) => Promise<void>
</td><td>
Method to initialize the XComponents app.
</td></tr>
<tr><td>
[search](./x-components.xapi.search.md)
</td><td>
</td><td>
(query?: string) => void
</td><td>
Dispatch a search with the query parameter.
</td></tr>
<tr><td>
[setSnippetConfig](./x-components.xapi.setsnippetconfig.md)
</td><td>
</td><td>
(config: Partial<[SnippetConfig](./x-components.snippetconfig.md)<!-- -->>) => void
</td><td>
To set or update any property of the [SnippetConfig](./x-components.snippetconfig.md)<!-- -->.
</td></tr>
</tbody></table>