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:
sylius_api:
enabled: true
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:
fifty_deg_sylius_degditor_base:
headless:
preview_token: 'your-custom-token'
preview_token_header: 'X-Custom-Preview-Header'
From that point on, use your custom header in API requests.