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
@@ -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,