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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user