From 331292e9b470bbaa74f9fcd4cfe3377a9ffb115e Mon Sep 17 00:00:00 2001
From: Yen Truong <36055303+yen-tt@users.noreply.github.com>
Date: Wed, 7 Sep 2022 12:59:53 -0400
Subject: [PATCH] update readme to reflect SearchHeadlessProvider changes
(#159)
update readme wording now that `SearchHeadlessProvider` requires a `SearchHeadless` instance instead of directly passing in the credentials.
---
README.md | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/README.md b/README.md
index 8ccabd0..ff37867 100644
--- a/README.md
+++ b/README.md
@@ -25,21 +25,19 @@ npm install @yext/search-headless-react
## Getting Started - `SearchHeadlessProvider`
-Search Headless React includes an `` component, which instantiates an SearchHeadless instance and makes it available to the rest of your app.
+Search Headless React includes an `` component, which takes in a `SearchHeadless` instance and makes it available to the rest of your app. `SearchHeadless` instance is created using `provideHeadless(...)` with the appropriate credentials:
```tsx
-import { SearchHeadlessProvider } from '@yext/search-headless-react';
+import { provideHeadless, SearchHeadlessProvider } from '@yext/search-headless-react';
import SearchBar from './SearchBar';
import MostRecentSearch from './MostRecentSearch';
import UniversalResults from './UniversalResults';
+const searcher = provideHeadless(config);
+
function MyApp() {
return (
-
+
{/* Add components that use Search as children */}