Unable to view sharable link to a non prismic user

Hello prismic support team!

I might be misunderstanding how the sharable preview link works or I'm running into an issue.

I've set up a preview at my site at this url https://dd-sample-next-js-blog.nikibrown.vercel.app and this is working correctly for me. I am able to view this when I am logged in as my prismic user, but if I share this to a coworker they see a blank page. I think I have things for preview set up correctly as I cloned the next.js blog project from here: https://user-guides.prismic.io/en/articles/2882569-sample-blog-with-api-based-cms-in-next-js

You can find my github repo here https://github.com/nikibrown/dd-sample-next-js-blog
And my prismic repo here https://dd-sample-next-js-blog.prismic.io/

From what I am assuming this url for example in the screenshot should allow anyone to preview the unpublished content. In this case I'm trying to share unpublished blog posts that are part of a release. Screenshot:

Thanks!

  • Niki Brown
1 Like

Hello Niki, thank you for reaching out. This is a known issue we're aware of and already tracking.

We will work on making enhancements to the preview functionality with Next.js in the future, but without a rough ETA for the moment. So, unfortunately there's still no workaround to make the sharable link work. As soon as we make progress or have any news about this we'll let everyone know in this same thread.

@Pau It might be good to disable the display of the link if its known that this feature is broken. I did a product demo to my whole team and it was frustrating that it did not work. The preview functionality without building is one of the reasons why we are switching platforms. It would be nice if Prismic would clearly label things as "beta" if they are not ready to be used. Even if this was working at one point you should remove it.

Thanks,

N

Thank you very much for the feedback, I'll be sure to mention this to the product team.
And, whenever I have news about this issue getting fixed I'll let you know.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Hi,

A fix that is related to this issue has been released, can you please check?

This issue has been closed due to inactivity. Flag to reopen.

Hi @Fares,

You mentioned something about a fix related to this issue been released, but we're still experiencing it. Our previews work like a charm, except when giving a sharable link to a non prismic user. We're using Next.js too.

@jrodriguez I'm really sorry for the confusion; this issue is in work now and wasn't released.

I will let you know if I get any updates.

2 Likes

This thread is being monitored as an open ticket in the issue tracker. We will update this post as we get more information. If you have a similar use-case, you can ‘Flag’ this topic to reopen.

@Fares Is there an update on a fix for this issue ?
Still facing the same bug with shareable links.

Hi @saurish,

You should be able to use shareable links with Next.js if you follow the set-up here, although because of the way that Next.js's preview system works there is still an issue with shareable links for unpublished documents:

The team is working on a prismic-next plugin that should hopefully resolve this issue, it will be released in BETA in January (Fingers crossed):

Thanks.

1 Like

Hi,
Any updates on this issue? Still facing the same problem with shareable links here, or perhaps is a new bug?

Hello @phillip_pan can you describe your issue in more detail?
We haven't had any problems with shareable links lately, they should be working just fine with the new kit.

Hi @Pau,
Thanks for the reply, the problem can be reproduced through the following steps.

  1. Create a multiple changes release
  2. Click the preview button
    image
  3. Generate the shareable link
  4. Share it with others

The shareable preview link is working fine when I open it up myself, but it didn't work when showing it to others. Even when sharing to Prismic users (Same Prismic repo).

Have you made sure that the toolbar script is added to every page in your application? sometimes the toolbar will show up on a certain page because there's a linked document that gets detected by the toolbar, a menu bar, or an information card, and the main page gets ignored.

@Pau I'm having the same problem. I can't use @prismic/next package just yet since the project is using client v4 and we are not yet ready to upgrade to v6.

Previews are working great and the share links are working when opening myself in the same browser. However, when I try to open them in another browser as a non logged in user, nothing happens - the page just opens with no toolbar enabled.

From the console.log, I can see the previewData is not set and it looks like the /api/preview endpoint is not hit at all (as opposed to normal Previews).

This is quite urgent as my client can't share links with colleagues, so any assistance will be greatly appreciated.

There are no errors in the console.

Looks like the main problem is that the preview link doesn't hit /preview/api which means that my Next.js app doesn't realise that it's a preview link, therefore it renders the page as normal


I just noticed that the repository has Private API access (with access token) - and that probably impacts if I can share to non-prismic users. Is there a way to share to non-prismic users while keeping it as a Private API?

Edit: I set the API to Public temporarily but this didn't fix the problem

1 Like