docs: added medusa-react snippets in how-to guides (#3091)

* added medusa-react snippets

* added more code snippets

* added medusa-react snippets

* docs: added medusa-react snippets to storefront how-to

* docs: added medusa-react snippets in admin how-to

* docs: fixed incorrect link
This commit is contained in:
Shahed Nasser
2023-01-23 21:04:09 +02:00
committed by GitHub
parent 7418a0025c
commit a248bf6e4f
23 changed files with 3032 additions and 169 deletions

View File

@@ -286,11 +286,20 @@ components:
In this API reference, you'll find in the cURL request samples the use of `{api_token}`. This is where you must pass the API token.
If you're alternatively following along with the JS Client request samples, you must provide the `apiKey` option when creating the Medusa client:
If you're following along with the JS Client request samples, you must provide the `apiKey` option when creating the Medusa client:
```js
```ts
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3, apiKey: '{api_token}' })
```
If you're using Medusa React, you can pass the `apiKey` prop to `MedusaProvider`:
```tsx
<MedusaProvider
apiKey='api_token}'
//...
>
```
scheme: bearer
cookie_auth:
type: apiKey