docs: added beta features documentation (#4859)

This commit is contained in:
Shahed Nasser
2023-08-25 14:59:20 +03:00
committed by GitHub
parent 7aaa332a32
commit 6d94c0c181
4 changed files with 132 additions and 5 deletions
+118
View File
@@ -0,0 +1,118 @@
---
description: "In this document, youll learn about the current beta features in Medusa and how to enable them. This can include features that are hidden by a feature flag, or available by installing beta versions of some packages."
---
# Beta Features
In this document, youll learn about the current beta features in Medusa and how to enable them. This can include features that are hidden by a feature flag, or available by installing `beta` versions of some packages.
## Product Categories
Organize products into categories of different hierarchies. You can have as many nested categories as necessary. You can also showcase the categories on your storefront.
![Product categories demo](https://res.cloudinary.com/dza7lstvk/image/upload/v1692953661/Medusa%20Docs/Screenshots/product-categories-docs_dfztge.jpg)
Check out the [product categories](./modules/products/categories.md) documentation for more details on this feature.
### How to Enable Product Categories
To enable product categories you can either:
1. Set the `MEDUSA_FF_PRODUCT_CATEGORIES` environment variable to `true`.
2. Or set the `product_categories` key in the Medusa backend's `featureFlags` setting to `true`.
You can learn more about enabling it in the [feature flags documentation](./development/feature-flags/toggle.md).
---
## Tax-Inclusive Pricing
Specify prices with taxes included. Medusa then takes care of calculating the tax amount applied in each region.
![Tax-inclusive pricing demo](https://res.cloudinary.com/dza7lstvk/image/upload/v1692957355/Medusa%20Docs/Screenshots/tax-docs_c3isnj.jpg)
Check out the [tax-inclusive pricing](./modules/taxes/inclusive-pricing.md) documentation for more details on this feature.
### How to Enable Tax-Inclusive Pricing
To enable tax-inclusive pricing you can either:
1. Set the `MEDUSA_FF_TAX_INCLUSIVE_PRICING` environment variable to `true`.
2. Or set the `tax_inclusive_pricing` key in the Medusa backend's `featureFlags` setting to `true`.
You can learn more about enabling it in the [feature flags documentation](./development/feature-flags/toggle.md).
---
## Order Editing
:::tip
This feature is enabled by default.
:::
Edit orders in your store by adding, updating, or deleting items in the order. You can also require customer confirmation of the order edit and process payment, such as authorizing additional payment or refunding the difference from the original payment.
![Order edits demo](https://res.cloudinary.com/dza7lstvk/image/upload/v1692955472/Medusa%20Docs/Screenshots/order-editing-docs_vltgqt.jpg)
Check out the [order edits](./modules/orders/orders.md#order-edits) documentation for more details on this feature.
### How to Enable Order Editing
To enable order editing you can either:
1. Set the `MEDUSA_FF_ORDER_EDITING` environment variable to `true`.
2. Or set the `order_editing` key in the Medusa backend's `featureFlags` setting to `true`.
You can learn more about enabling it in the [feature flags documentation](./development/feature-flags/toggle.md).
---
## Sales Channels
:::tip
This feature is enabled by default.
:::
Support an omnichannel experience by specifying product availability in various sales channels.
![Sales channels demo](https://res.cloudinary.com/dza7lstvk/image/upload/v1692956765/Medusa%20Docs/Screenshots/sc-docs_ggcuuw.jpg)
Check out the [sales channels](./modules/sales-channels/overview.mdx) documentation for more details on this feature.
### How to Enable Sales Channels
To enable sales channels you can either:
1. Set the `MEDUSA_FF_SALES_CHANNELS` environment variable to `true`.
2. Or set the `sales_channels` key in the Medusa backend's `featureFlags` setting to `true`.
You can learn more about enabling it in the [feature flags documentation](./development/feature-flags/toggle.md).
---
## Publishable API Keys
:::tip
This feature is enabled by default.
:::
Create API keys that can be used by storefront clients, such as websites or mobile apps, to specify the context and resources associated with your request. Publishable API keys promote an omnichannel experience managed through the admin.
![Publishable API Keys demo](https://res.cloudinary.com/dza7lstvk/image/upload/v1692956121/Medusa%20Docs/Screenshots/pak-docs_cac8qy.jpg)
Check out the [publishable API keys](./development/publishable-api-keys/index.mdx) documentation for more details on this feature.
### How to Enable Publishable API Keys
To enable publishable API keys you can either:
1. Set the `MEDUSA_FF_PUBLISHABLE_API_KEYS` environment variable to `true`.
2. Or set the `publishable_api_keys` key in the Medusa backend's `featureFlags` setting to `true`.
You can learn more about enabling it in the [feature flags documentation](./development/feature-flags/toggle.md).
@@ -15,7 +15,7 @@ Feature flags are used in Medusa to guard beta features that arent ready for
If a feature is guarded by a flag, entities, migrations, endpoints, and other resources associated with that feature are guarded by that flag as well. So, these resources will only be available to use in Medusa if you have enabled the associated feature flag.
You can view a list of available feature flags that you can toggle in [the Medusa GitHub mono-repository](https://github.com/medusajs/medusa/tree/master/packages/medusa/src/loaders/feature-flags). In each feature flag file, you can find the default value of the feature flag, its name, environment variable name, and more.
You can view a list of available feature flags that you can toggle in [the Beta Features documentation](../../beta.md).
<DocCard item={{
type: 'link',
@@ -25,21 +25,21 @@ There are two ways to enable a feature flag.
### Method One: Using Environment Variables
You can enable a feature by setting the value of its environment variable to `true`. You can find [the name of a feature flags environment variable in the loader file](https://github.com/medusajs/medusa/tree/master/packages/medusa/src/loaders/feature-flags) its defined in. It is defined under the property `env_key` in the exported object.
You can enable a feature by setting the value of its environment variable to `true`. You can find [the name of a feature flags environment variable in the Beta Features documentation page](../../beta.md).
For example, to enable the Tax-Inclusive Pricing beta feature, add the following environment variable:
```jsx
```bash
MEDUSA_FF_TAX_INCLUSIVE_PRICING=true
```
### Method Two: Using Backend Configurations
You can enable a feature by using the backend configurations in `medusa-config.js`. You can find [a feature flags key in the loader file](https://github.com/medusajs/medusa/tree/master/packages/medusa/src/loaders/feature-flags) its defined in. It is defined under the property `key` in the exported object.
You can enable a feature by using the backend configurations in `medusa-config.js`. You can find [the feature flags key in the Beta Features documentation page](../../beta.md) its defined in. It is defined under the property `key` in the exported object.
For example, to enable the Tax-Inclusive Pricing beta feature, add the following to the exported object in `medusa-config.js`:
```jsx title=medusa-config.js
```js title=medusa-config.js
module.exports = {
featureFlags: {
tax_inclusive_pricing: true,
+9
View File
@@ -219,6 +219,15 @@ module.exports = {
},
className: "homepage-sidebar-item",
},
{
type: "doc",
id: "beta",
label: "Beta Features",
customProps: {
sidebar_icon: "adjustments",
},
className: "homepage-sidebar-item",
},
{
type: "category",
label: "Deploy",