diff --git a/docs/content/add-plugins/minio.md b/docs/content/add-plugins/minio.md index 551149ae6d..3053b7f007 100644 --- a/docs/content/add-plugins/minio.md +++ b/docs/content/add-plugins/minio.md @@ -46,7 +46,11 @@ Then configure your `medusa-config.js` to include the plugin alongside the requi The two access keys in the options are the ones created in the previous section. -> Make sure to use an environment variable for the secret key in a live environment. +:::tip + +Make sure to use an environment variable for the secret key in a live environment. + +::: ### Try it out diff --git a/docs/content/add-plugins/s3.md b/docs/content/add-plugins/s3.md index d3059732c0..0fdf04a4bf 100644 --- a/docs/content/add-plugins/s3.md +++ b/docs/content/add-plugins/s3.md @@ -78,7 +78,11 @@ https://[bucket].s3.[region].amazonaws.com The two access keys in the options are the ones created in the previous section. -> Make sure to use an environment variable for the secret key in a live environment. +:::tip + + Make sure to use an environment variable for the secret key in a live environment. + +::: ### Try it out diff --git a/docs/content/add-plugins/segment.md b/docs/content/add-plugins/segment.md index eccf0c414f..ebf1fbb72a 100644 --- a/docs/content/add-plugins/segment.md +++ b/docs/content/add-plugins/segment.md @@ -21,7 +21,11 @@ Common integration use cases that can be implemented with Segment include: ## Adding Segment to your Medusa store -> Note: you should create a [Node.js source in Segment](https://segment.com/docs/connections/sources/catalog/libraries/server/node/quickstart/) in order to obtain the write key that will be provided in the plugin options. +:::note + +You should create a [Node.js source in Segment](https://segment.com/docs/connections/sources/catalog/libraries/server/node/quickstart/) in order to obtain the write key that will be provided in the plugin options. + +::: Plugins in Medusa's ecosystem come as separate npm packages, that can be installed from the npm registry. diff --git a/docs/content/add-plugins/spaces.md b/docs/content/add-plugins/spaces.md index 27d856e030..7119db049a 100644 --- a/docs/content/add-plugins/spaces.md +++ b/docs/content/add-plugins/spaces.md @@ -47,7 +47,11 @@ Then configure your `medusa-config.js` to include the plugin alongside the requi In the above options, a `spaces_url` is included. This can be found in your Space overview. The `bucket` should point to the name you gave your Space. The `endpoint` identifies the region in which you created the Space. And finally the two keys are the ones created in the previous section. -> Make sure to use an environment variable for the secret key in a live environment. +:::tip + +Make sure to use an environment variable for the secret key in a live environment. + +::: ### Try it out! diff --git a/docs/content/add-plugins/strapi.md b/docs/content/add-plugins/strapi.md index 1ec6ebac98..91f6e6c92d 100644 --- a/docs/content/add-plugins/strapi.md +++ b/docs/content/add-plugins/strapi.md @@ -37,7 +37,11 @@ Alternatively, using Yarn: yarn create medusa-app ``` -> When choosing `npx` you are shown different store engine options as part of the setup. For this Strapi tutorial, you should choose `medusa-starter-default`. Optionally, pick a storefront. +:::note + +When choosing `npx` you are shown different store engine options as part of the setup. For this Strapi tutorial, you should choose `medusa-starter-default`. Optionally, pick a storefront. + +::: **Use `medusa-cli`** `@medusajs/medusa-cli` is our Command Line Tool for creating the Medusa store engine (alongside many other powerful commands). First, install it: @@ -116,12 +120,19 @@ Alternatively, using Yarn: yarn global add create-strapi-app@3.6.8 create-strapi-app strapi-medusa --template https://github.com/Deathwish98/strapi-medusa-template.git ``` +:::note -> Note: The plugin expects node version to be '>= 10.16.0 and <=14.x.x', otherwise it will throw an error. +The plugin expects node version to be '>= 10.16.0 and <=14.x.x', otherwise it will throw an error. + +::: After running the command, you have a full Strapi project configured to synchronize with Medusa. Upon the initial start of the Strapi server, all the required models will be created. They will correlate with models from Medusa to allow for two-way synchronization. -> Note: The Strapi template starter uses SQLite as the default database. There is a known bug related to `knex.js` that comes from multiple write connections. Restarting the Strapi server should make the error disappear. +:::caution + +The Strapi template starter uses SQLite as the default database. There is a known bug related to `knex.js` that comes from multiple write connections. Restarting the Strapi server should make the error disappear. + +::: **Synchronization** @@ -133,7 +144,11 @@ When products are created in Medusa, the two-way communication ensures that data **Variants**: title **Region**: name -> Further down the road, the support for synchronizing more entities is expected to be introduced +:::note + +Further down the road, the support for synchronizing more entities is expected to be introduced + +::: **Using Postgres in Medusa (optional)** @@ -157,7 +172,11 @@ projectConfig: { }, ``` -> Note: the `DATABASE_URL` variable should use the Postgres database created in the previous step +:::tip + +The `DATABASE_URL` variable should use the Postgres database created in the previous step + +::: ## Summary and next steps diff --git a/docs/content/advanced/backend/payment/frontend-payment-flow-in-checkout.md b/docs/content/advanced/backend/payment/frontend-payment-flow-in-checkout.md index f18c3746aa..eeb1ba83a9 100644 --- a/docs/content/advanced/backend/payment/frontend-payment-flow-in-checkout.md +++ b/docs/content/advanced/backend/payment/frontend-payment-flow-in-checkout.md @@ -2,12 +2,17 @@ ## Introduction The purpose of this guide is to describe a checkout flow in Medusa. It is assumed that you've completed our [Quickstart](https://docs.medusajs.com/quickstart/quick-start) or [Tutorial](https://docs.medusajs.com/tutorial/set-up-your-development-environment) and are familiar with the technologies we use in our stack. Additionally, having an understanding of the [core API](https://docs.medusajs.com/api/store/auth) would serve as a great foundation for this walkthrough. -> All code snippets in the following guide, use the JS SDK distributed through **npm**. To install it, run: + +:::note + +All code snippets in the following guide, use the JS SDK distributed through **npm**. To install it, run: ```bash npm2yarn npm install @medusajs/medusa-js ``` +::: + ## Glossary - **Cart**: The Cart contains all the information needed for customers to complete an Order. In the Cart customers gather the items they wish to purchase, they add shipping and billing details and complete payment information. - **LineItem**: Line Items represent an expense added to a Cart. Typically this will be a Product Variant and a certain quantity of the same variant. Line Items hold descriptive fields that help communicate its contents and price. @@ -17,7 +22,12 @@ npm install @medusajs/medusa-js ## Checkout flow To create an order from a cart, we go through the following flow. -> At this point, it assumed that the customer has created a cart, added items and is now at the initial step of the checkout flow. + +:::note + +At this point, it assumed that the customer has created a cart, added items and is now at the initial step of the checkout flow. + +::: ### Initializing the checkout The first step in the flow is to _initialize_ the configured Payment Sessions for the Cart. If you are using the `medusa-starter-default` starter, this call will result in the `cart.payment_sessions` array being filled with one Payment Session for the manual payment provider. diff --git a/docs/content/advanced/backend/subscribers/create-subscriber.md b/docs/content/advanced/backend/subscribers/create-subscriber.md index c902ca7d0a..f8e711419d 100644 --- a/docs/content/advanced/backend/subscribers/create-subscriber.md +++ b/docs/content/advanced/backend/subscribers/create-subscriber.md @@ -69,7 +69,11 @@ export default OrderNotifierSubscriber; This subscriber will register the method `handleOrder` as one of the handlers of the `order.placed` event. The method `handleOrder` will be executed every time an order is placed, and it will receive the order ID in the `data` parameter. You can then use the order’s details to perform any kind of task you need. -> The `data` object will not contain other order data. Only the ID of the order. You can retrieve the order information using the `orderService`. +:::note + +The `data` object will not contain other order data. Only the ID of the order. You can retrieve the order information using the `orderService`. + +::: ## Using Services in Subscribers diff --git a/docs/content/guides/plugins.md b/docs/content/guides/plugins.md index 2516702c5c..07fcf5e36d 100644 --- a/docs/content/guides/plugins.md +++ b/docs/content/guides/plugins.md @@ -12,7 +12,11 @@ Plugins offer a way to extend and integrate the core functionality of Medusa. In most commerce solutions, you can extend the basic features but it often comes with the expense of having to build standalone web applications. Our architecture is built such that plugins run within the same process as the core eliminating the need for extra server capacity, infrastructure and maintenance. As a result, the plugins can use all other services as dependencies and access the database. -> You will notice that plugins vary in naming. The name should signal what functionality they provide. +:::note + +You will notice that plugins vary in naming. The name should signal what functionality they provide. + +::: In the following sections, we will go through the basics of implementing a generic plugin. And finally, how to use it as part of your commerce setup. @@ -34,7 +38,11 @@ We've already gone through the process of building custom services, endpoints, a To quickly get started with the implementation, we advise you to copy `/services/welcome.js`, `/api/index.js`, `/subscribers/welcome.js` and the config files from the tutorial and add them in `/src`. As a result, you should have the following folder structure: -> Please note: since the container resolution paths are automatically generated from the used directories and filenames you should avoid pre- or suffixing your file (e.g. `services/welcomeService.js` would result in the service being registered as `WelcomeServiceService`). +:::note + +Since the container resolution paths are automatically generated from the used directories and filenames you should avoid pre- or suffixing your file (e.g. `services/welcomeService.js` would result in the service being registered as `WelcomeServiceService`). + +::: ```js . @@ -55,7 +63,11 @@ Please note that you will need some build step before being able to properly loa It is worth mentioning the difference between building a generic and a non-generic plugin. A non-generic plugin has a specific purpose such as processing payments or creating fulfillments. Medusa core depends on a specific implementation from such plugins, which is why we've created interfaces that enforce this. These can be found in `medusa-interfaces`. -> Note: Non-generic plugins are required to extend the correct interface, otherwise they will not be loaded correctly as part of your Medusa setup. +:::note + +Non-generic plugins are required to extend the correct interface, otherwise they will not be loaded correctly as part of your Medusa setup. + +::: For a more comprehensive walkthrough of the implementation of such plugins, see our guides: diff --git a/docs/content/homepage.mdx b/docs/content/homepage.mdx index 65950a1444..63a7c8740d 100644 --- a/docs/content/homepage.mdx +++ b/docs/content/homepage.mdx @@ -23,35 +23,35 @@ You can learn more about Medusa's architecture in [our introduction](/introducti  -