# ReactifySearchLiquidFactory

### Purpose

The ReactifySearchLiquidFactory class provides helper functions when implementing Reactify Search on a Shopify theme.

### Usage

The `ReactifySearchLiquidFactory` class must be initialised with the mode prop and called before rendering your React application.

The class automatically sets the standard required props for `ReactifySearchProvider`: `shopifyPermanentDomain` and `collectionHandle`.&#x20;

However, you can add more props, such as `market`. The list of available props can be found on [ReactSearchProvider](https://search.docs.reactify.com.au/components/provider#props).

```typescript
import { ReactifySearchLiquidFactory } from "@usereactify/search";

const ReactifySearchFactory = new ReactifySearchLiquidFactory({
  mode: "instant-search",
  market="12345" // optionally the ID of the Shopify market to use
});
```

Three functions are provided to return the configured provider, mount node, and data loaded from the "reactify-data" script tag.

```typescript
const ReactifySearchProvider = ReactifySearchFactory.getProvider();

const ReactifySearchMountNode = ReactifySearchFactory.getMountNode();

const ReactifySearchData = ReactifySearchFactory.getData();
```

A theme installation guide can be found [here](https://search.docs.reactify.com.au/guides/liquid-theme) with examples on how to use these to render your React applications.

### Props

```typescript
type ReactifySearchLiquidFactoryProps = Omit<
  ReactifySearchProviderProps,
  "shopifyPermanentDomain"
> & {
  shopifyPermanentDomain?: string;
  collectionHandle?: string;
}
```
