Live article: https://www.storyblok.com/faq/how-to-verify-the-preview-query-parameters-of-the-visual-editor
- FAQ
- How to verify the preview query parameters of the visual editor?
If the user opens your page in Storyblok, we add a few parameters which you can use to securely validate their use of the edit mode.
You will need that validation to load the right version of your content to the right users. The draft
version is for the editor and the published
version is for the public.
A simple validation would be to check if there is the _storyblok parameter in url. This could be done in the frontend or in the backend. But for a secure check we recommend to implement the logic in the backend and validate the _storyblok_tk parameter.
Code Examples
Here are some examples of how to securely check if the user is in edit mode: