Configuration


Enabling the API in Production

To expose the API in a production environment, you must explicitly enable it in your Sylius project configuration.
Create or edit the config/packages/_sylius.yaml file:

config/packages/_sylius.yaml

1sylius_api: 2 enabled: true 3
Without this step, your API endpoints may not be publicly accessible outside the development environment.

Fetching Draft or Scheduled Content (Preview Mode)

By default, DegDitor's API will only return published entities.
To support page previews, scheduled publishing, or custom staging workflows, DegDitor provides a secure preview token mechanism.
To fetch unpublished content, include the following HTTP header in your API requests:
X-DegDitor-Preview-Token: h34d1355_53cr3t
This token ensures that only authorized preview clients can access content that is still in draft or not yet published.

Customizing the Token and Header

You can define your own preview token and header name by adding this configuration:

config/packages/fifty_deg_sylius_degditor_plugin_headless.yaml

1fifty_deg_sylius_degditor_base: 2 headless: 3 preview_token: 'your-custom-token' 4 preview_token_header: 'X-Custom-Preview-Header' 5
From that point on, use your custom header in API requests.
Three, two, one...

Ready for DegDitor?

Try the plugin

Experience the best features at no cost

Get a better understanding of DegDitor and how it works

Test it risk-free and see the results

Try it

Get a demo

Get a personalized demo tailored to your unique needs

Preview our pricing plans

Evaluate DegDitor against your requirements

Get a demo

We are here for you

After months of intense development, it’s time to put DegDitor to work. For feedback, questions or information please contact us!

Contact us