docs: added dividers + see also section (#2899)

This commit is contained in:
Shahed Nasser
2022-12-26 15:52:08 +02:00
committed by GitHub
parent b0e5769e27
commit b0ebfd6bcf
100 changed files with 1047 additions and 291 deletions
+8
View File
@@ -12,6 +12,8 @@ To install the Medusa JS Client run the following command:
npm install @medusajs/medusa-js
```
---
## Usage
Import Medusa as a default import and initiate it:
@@ -22,6 +24,8 @@ import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa()
```
---
## How to Use this Reference
You'll find in the sidebar of this reference names of different resources. These resources are properties in the medusa instance you initialize and you can access them directly using the instance. Then, you'll be able to access the methods or nested resources within those resources.
@@ -47,6 +51,8 @@ medusa.customers.addresses.addAddress({
})
```
---
## Authentication
Authentication can be achieved in two ways using the `medusa-js` client: either by utilizing API keys or by using cookie based authentication. Each method has its own unique use case.
@@ -59,6 +65,8 @@ API keys can only be used for admin functionality in Medusa since only users of
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.
---
## Configuration
### Initialize with config object