2017-07-12 20:00:47 +02:00
# With Algolia React InstantSearch example
## How to use
2017-12-03 05:30:17 +01:00
### Using `create-next-app`
2018-04-03 14:19:05 +02:00
Execute [`create-next-app` ](https://github.com/segmentio/create-next-app ) with [Yarn ](https://yarnpkg.com/lang/en/docs/cli/create/ ) or [npx ](https://github.com/zkat/npx#readme ) to bootstrap the example:
2017-12-03 05:30:17 +01:00
2018-03-14 09:09:46 +01:00
```bash
npx create-next-app --example with-algolia-react-instantsearch with-algolia-react-instantsearch-app
# or
yarn create next-app --example with-algolia-react-instantsearch with-algolia-react-instantsearch-app
2017-12-03 05:30:17 +01:00
```
### Download manually
2018-07-11 23:56:15 +02:00
Download the example:
2017-07-12 20:00:47 +02:00
```bash
2017-12-07 03:12:42 +01:00
curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-algolia-react-instantsearch
2017-07-12 20:00:47 +02:00
cd with-algolia-react-instantsearch
```
Set up Algolia:
2019-04-22 16:56:02 +02:00
2017-07-12 20:00:47 +02:00
- create an [algolia ](https://www.algolia.com/ ) account or use this already [configured index ](https://community.algolia.com/react-instantsearch/Getting_started.html#before-we-start )
- update the appId, apikey and indexName you want to search on in components/app.js
Install it and run:
```bash
npm install
npm run dev
2018-04-03 14:19:05 +02:00
# or
yarn
yarn dev
2017-07-12 20:00:47 +02:00
```
Deploy it to the cloud with [now ](https://zeit.co/now ) ([download](https://zeit.co/download))
```bash
now
```
## The idea behind the example
2019-04-22 16:56:02 +02:00
2017-07-12 20:00:47 +02:00
The goal of this example is to illustrate how you can use [Algolia React InstantSearch ](https://community.algolia.com/react-instantsearch/ ) to perform
2019-03-07 17:40:08 +01:00
your search with a Server-rendered application developed with Next.js. It also illustrates how you
can keep in sync the Url with the search.