docs: added how to retrieve keys in client references (#4127)
* docs: added how to retrieve keys in js client guide * added details about retrieving keys in medusa react
This commit is contained in:
@@ -65,9 +65,11 @@ Authentication can be achieved in two ways using the `medusa-js` client: either
|
||||
|
||||
API keys can only be used for admin functionality in Medusa since only users of the admin system have API keys. Refer to the [Configuration](#configuration) section to learn how to add the API key to requests.
|
||||
|
||||
You can follow [this guide](/api/admin#section/Authentication/api_token) to learn how to create an API key for an admin user.
|
||||
|
||||
### Using cookies
|
||||
|
||||
Authentication using cookies is done automatically by Axios when authenticating using the [auth](/references/js-client/classes/AuthResource) endpoints. After authentication, all subsequent calls will be authenticated.
|
||||
Authentication using cookies is done automatically by Axios, which is used within the Medusa JS Client, when authenticating using the [auth](/references/js-client/classes/AuthResource) endpoints. After authentication, all subsequent calls will be authenticated.
|
||||
|
||||
---
|
||||
|
||||
@@ -89,4 +91,4 @@ const medusa = new Medusa({
|
||||
| `maxRetries` | `0` | The amount of times a request is retried. |
|
||||
| `baseUrl` | `'http://localhost:9000'` | The url to which requests are made to. |
|
||||
| `apiKey` | `''` | Optional API key used for authenticating admin requests. |
|
||||
| `publishableApiKey` | `''` | Optional publishable API key used for storefront requests.|
|
||||
| `publishableApiKey` | `''` | Optional publishable API key used for storefront requests. You can create a publishable API key either using the [admin APIs](../development/publishable-api-keys/admin/manage-publishable-api-keys.mdx) or the [Medusa admin](../user-guide/settings/publishable-api-keys.mdx). |
|
||||
@@ -83,8 +83,8 @@ You can also pass the following props to Medusa Provider:
|
||||
|
||||
| Props | Default | Description |
|
||||
| ------------------- | ------------------------- | --------------------------------------------------------- |
|
||||
| `apiKey` | `''` | Optional API key used for authenticating admin requests. |
|
||||
| `publishableApiKey` | `''` | Optional publishable API key used for storefront requests.|
|
||||
| `apiKey` | `''` | Optional API key used for authenticating admin requests. Follow [this guide](/api/admin#section/Authentication/api_token) to learn how to create an API key for an admin user. |
|
||||
| `publishableApiKey` | `''` | Optional publishable API key used for storefront requests. You can create a publishable API key either using the [admin APIs](../development/publishable-api-keys/admin/manage-publishable-api-keys.mdx) or the [Medusa admin](../user-guide/settings/publishable-api-keys.mdx). |
|
||||
|
||||
### Queries
|
||||
|
||||
|
||||
Reference in New Issue
Block a user