UNPKG

@empathyco/x-components

Version:
25 lines (16 loc) 1.39 kB
<!-- 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 ``` ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | | [addProductToCart](./x-components.xapi.addproducttocart.md) | | (productId?: string) =&gt; void | To track that a product was added to the cart from PDP. | | [getSnippetConfig](./x-components.xapi.getsnippetconfig.md) | | () =&gt; [SnippetConfig](./x-components.snippetconfig.md) | To get the snippet config object. | | [init](./x-components.xapi.init.md) | | (config: [SnippetConfig](./x-components.snippetconfig.md)<!-- -->) =&gt; Promise&lt;void&gt; | Method to initialize the XComponents app. | | [search](./x-components.xapi.search.md) | | (query?: string) =&gt; void | Dispatch a search with the query parameter. | | [setSnippetConfig](./x-components.xapi.setsnippetconfig.md) | | (config: Partial&lt;[SnippetConfig](./x-components.snippetconfig.md)<!-- -->&gt;) =&gt; void | To set or update any property of the [SnippetConfig](./x-components.snippetconfig.md)<!-- -->. |