Sets up an API route for enabling draft mode, can be paired with the previewUrl.previewMode.enable in sanity/presentation.
Can also be used with sanity-plugin-iframe-pane.
When the preview loads in a cross-site iframe (Presentation Tool), draft-mode
cookies are set with the CHIPS Partitioned attribute so Safari 18.4+ stores
them despite third-party cookie blocking. Top-level / same-site requests keep
unpartitioned cookies so draftMode().disable() continues to work.
Sets up an API route for enabling draft mode, can be paired with the
previewUrl.previewMode.enableinsanity/presentation. Can also be used withsanity-plugin-iframe-pane.When the preview loads in a cross-site iframe (Presentation Tool), draft-mode cookies are set with the CHIPS
Partitionedattribute so Safari 18.4+ stores them despite third-party cookie blocking. Top-level / same-site requests keep unpartitioned cookies sodraftMode().disable()continues to work.