Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview URL Sharing feature not showing up #2136

Closed
fcisio opened this issue Nov 7, 2024 · 1 comment · Fixed by #2137
Closed

Preview URL Sharing feature not showing up #2136

fcisio opened this issue Nov 7, 2024 · 1 comment · Fixed by #2137

Comments

@fcisio
Copy link

fcisio commented Nov 7, 2024

Describe the bug

Hi, I'm all setup in accordance with the Live content API docs, but for some reason, the Preview URL sharing feature is not showing up in my studio.

I indeed pass both the serverToken & browserToken.

Expected behavior

The result should match what is detailed in the docs/README

Screenshots
ScreenShot 2024-11-07 at 1 29 07 PM

Which versions of Sanity are you using?

Run sanity versions in the terminal and copy-paste the result here.
@sanity/cli (global) 3.63.0 (up to date)
@sanity/assist 3.0.8 (up to date)
@sanity/code-input 4.1.4 (up to date)
@sanity/dashboard 4.1.0 (up to date)
@sanity/eslint-config-studio 4.0.0 (up to date)
@sanity/image-url 1.1.0 (up to date)
@sanity/locale-fr-fr 1.2.12 (up to date)
@sanity/preview-url-secret 2.0.1 (up to date)
@sanity/vision 3.63.0 (up to date)
sanity 3.63.0 (up to date)

What operating system are you using?
Mac OS

Which versions of Node.js / npm are you running?
10.9.0
v20.9.0

Additional context
I am defining the draft-mode/enable API route properly

export const { GET } = defineEnableDraftMode({
  client: sanity.client.withConfig({ token })
})
@stipsan stipsan transferred this issue from sanity-io/next-sanity Nov 11, 2024
@stipsan
Copy link
Member

stipsan commented Nov 11, 2024

@fcisio got a fix up #2137, in the meantime you should be able to workaround this by changing your presentationTool.draftMode.enable configuration to presentationTool.previewMode.enable to make it work:

import {presentationTool} from 'sanity/presentation'

presentationTool({
  previewUrl: {
-   draftMode: {
+   previewMode: {
      enable: '/api/draft-mode/enable'
    }
  }
})

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants