# Unable to view sharable link to a non prismic user

**URL:** <https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243>\
**Category:** Developing with Prismic\
**Created:** [December 17, 2020, 11:15pm UTC](https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243 "2020-12-17T23:15:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![niki.brown](https://avatars.discourse-cdn.com/v4/letter/n/c57346/32.png) [@niki.brown](https://community.prismic.io/u/niki.brown)\
**Post date:** [December 17, 2020, 11:15pm UTC](https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243/1 "2020-12-17T23:15:56Z")

</div>

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](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](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](https://github.com/nikibrown/dd-sample-next-js-blog)  
And my prismic repo here [https://dd-sample-next-js-blog.prismic.io/](https://dd-sample-next-js-blog.prismic.io/)

 ![](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/5/5f233f0bff1b0866db117320f0fdbd5c219de8cc.jpeg)

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:

 ![](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/e/e801e5a5c650878a8e96b8ed1e5d816d6ee0c558.jpeg)

Thanks!

- Niki Brown

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [December 21, 2020, 9:42pm UTC](https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243/5 "2020-12-21T21:42:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![niki.brown](https://avatars.discourse-cdn.com/v4/letter/n/c57346/32.png) [@niki.brown](https://community.prismic.io/u/niki.brown)\
**Post date:** [December 22, 2020, 7:44pm UTC](https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243/7 "2020-12-22T19:44:11Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [December 23, 2020, 1:44am UTC](https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243/8 "2020-12-23T01:44:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 31, 2020, 6:55pm UTC](https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243/9 "2020-12-31T18:55:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [March 10, 2021, 5:59pm UTC](https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243/10 "2021-03-10T17:59:25Z")

</div>

Hi,

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

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [March 10, 2021, 5:59pm UTC](https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243/11 "2021-03-10T17:59:29Z")

</div>



---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [April 2, 2021, 8:56am UTC](https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243/13 "2021-04-02T08:56:26Z")

</div>

This issue has been closed due to inactivity. [Flag to reopen](https://community.prismic.io/t/re-open-a-thread/2175).

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [April 26, 2021, 11:00pm UTC](https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243/14 "2021-04-26T23:00:05Z")

</div>



---

<div class="post-metadata">

**Author:** ![jrodriguez](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@jrodriguez](https://community.prismic.io/u/jrodriguez)\
**Post date:** [April 26, 2021, 11:02pm UTC](https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243/15 "2021-04-26T23:02:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [April 27, 2021, 2:01pm UTC](https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243/17 "2021-04-27T14:01:01Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [July 29, 2021, 2:21pm UTC](https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243/18 "2021-07-29T14:21:00Z")

</div>

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.](https://community.prismic.io/t/re-open-a-thread/2175)

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 9, 2021, 4:20pm UTC](https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243/19 "2021-12-09T16:20:28Z")

</div>



---

<div class="post-metadata">

**Author:** ![saurish](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@saurish](https://community.prismic.io/u/saurish)\
**Post date:** [December 13, 2021, 9:57am UTC](https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243/20 "2021-12-13T09:57:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [December 13, 2021, 12:08pm UTC](https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243/24 "2021-12-13T12:08:08Z")

</div>

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:

> **[Previews with Next.js](https://prismic.io/docs/technologies/previews-nextjs)**
>
> This article will show you how to preview content changes without publishing your document or rebuilding your project.

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):

> <https://github.com/prismicio/prismic-next/issues/4>
>
> \## Overview
> 
> \`@prismic/next\` is a new package designed for making Prismic easi…er to use with a NextJS project. The original RFC from @angeloashmore and provides more background:
> 
> https://github.com/prismicio/prismic-next/issues/1
> 
> At the moment, the package is mostly focused around making it easier to to set up Prismic Previews with Next. As Next and/or Prismic itself release more updates, it's possible that this package could grow and adapt to whatever new features come out if necessary.
> 
> For this RFC, we'd like to gather feedback on the implementation from a developer experience perspective. Should we be doing more, should we be doing less? Could things be done in an easier, simpler way for the end user?
> 
> \### \`enableClientServerSupport\`
> 
> \`\`\`js
> export const enableClientServerSupport = (
> config: EnableClientServerSupportConfig,
> ): void =\> {
> if ("context" in config && config.context) {
> const previewData = config.context.previewData;
> 
> if (isPrismicNextPreviewData(previewData) && previewData.ref) {
> config.client.queryContentFromRef(previewData.ref);
> }
> } else if ("req" in config && config.req) {
> config.client.enableAutoPreviewsFromReq(config.req);
> }
> };
> \`\`\`
> enableClientServerSupport is a function that allows the end user to enable Previews with either \`PreviewData\` coming from NextJS context or a Prismic ref coming from the NextApiRequest. It's intended to be used in an end users \`createClient()\` function, like this:
> 
> \`\`\`js
> 
> import { enableClientServerSupport, CreateClientConfig } from 'prismic-next';
> 
> export const createClient = (config: CreateClientConfig) =\> {
> const client = Prismic.createClient(apiEndpoint);
> 
> enableClientServerSupport({
> client,
> context: config.context,
> req: config.req,
> });
> 
> return client;
> };
> \`\`\`
> 
> One thing we've been wondering is whether or not \`@prismic/next\` should offer its own \`createClient\` function that would run \`enableClientServerSupport\` under the hood. On one hand, it'd be nice to not have to worry about creating your own client, however, the fear is that we might deal with feature creep as users might have more needs with creating client outside of what we provide.
> 
> Would love to get feedback on whether or not we might want to provide one on our own or leave it as is.
> 
> \### \`\<PrismicPreview /\>\`
> 
> The PrismicPreview component is to be wrapped around the entire NextJS app. There are two reasons why we have this component:
> 
> 1. It's job is to add the PrismicToolbar to a NextJS app, there's a required param called \`repoName\` where you just pass it the name of your Prismic Repo and the correct URL for the toolbar is added in the necessary \`\<script /\>\` tag.
> 
> 2. There is a useEffect hook that adds event listeners that come from the Prismic Toolbar, so it can properly update when the Preview URL is triggered. It's listening for both \`prismicPreviewUpdate\` and \`prismicPreviewEnd\`.
> 
> By default, the updatePreviewURL is \`/api/preview\` and the exitPreviewURL is \`/api/exit-preview\`. The end user has an option to override both of those by passing their own URLs to the props. Here's what it looks like in usage:
> 
> \`\`\`js
> import { PrismicPreview } from 'prismic-next';
> 
> function MyApp({ Component, pageProps }: AppProps) {
> return (
> \<PrismicPreview repoName='smashing-mag-nick-1'\>
> \<Component {...pageProps} /\>;
> \</PrismicPreview\>
> );
> }
> 
> export default MyApp;
> \`\`\`
> 
> \### \`setPreviewData\` & \`redirectToPreviewURL\`
> 
> These are actually really straight forward, to be used when the \`prismicUpdatePreview\` event gets triggered from the toolbar. Usage:
> 
> \`\`\`js
> import { linkResolver, createClient } from '../../prismic-config';
> import \* as prismicNext from 'prismic-next';
> import { NextApiRequest, NextApiResponse } from 'next';
> 
> export default async (req: NextApiRequest, res: NextApiResponse) =\> {
> const client = createClient({ req });
> 
> prismicNext.setPreviewData({ req, res });
> 
> await prismicNext.redirectToPreviewURL({ res, client, linkResolver });
> };
> \`\`\`
> 
> Here is how they look under the hood:
> 
> \`redirectToPreviewURL\`
> \`\`\`js
> import { NextApiResponse } from "next";
> import { Client } from "@prismicio/client";
> import { LinkResolverFunction } from "@prismicio/helpers";
> 
> export type PreviewConfig = {
> res: NextApiResponse;
> client: Client;
> linkResolver: LinkResolverFunction;
> };
> 
> export async function redirectToPreviewURL({
> res,
> client,
> linkResolver,
> }: PreviewConfig): Promise\<void\> {
> const previewUrl = await client.resolvePreviewURL({
> linkResolver,
> defaultURL: "/",
> });
> 
> res.redirect(previewUrl);
> }
> \`\`\`
> \`setPreviewData\`
> 
> \`\`\`js
> import { NextApiResponse, NextApiRequest } from "next";
> 
> export type PreviewConfig = {
> req: NextApiRequest;
> res: NextApiResponse;
> };
> 
> export async function setPreviewData({
> req,
> res,
> }: PreviewConfig): Promise\<void\> {
> const { token: ref } = req.query;
> 
> res.setPreviewData({ ref });
> }
> 
> \`\`\`
> 
> \### \`exitPreview\`
> 
> This one is also pretty straight forward. Usage:
> 
> \`\`\`js
> import { NextApiResponse } from 'next';
> import { exitPreview } from 'prismic-next';
> 
> export default async function exit(\_: any, res: NextApiResponse) {
> exitPreview(\_, res);
> }
> 
> \`\`\`
> 
> 
> Under the hood:
> 
> \`\`\`js
> export async function exitPreview(\_: any, res: NextApiResponse): Promise\<void\> {
> // Exit the current user from "Preview Mode". This function accepts no args.
> res.clearPreviewData();
> 
> // Redirect the user back to the index page.
> res.writeHead(307, { Location: "/" });
> res.end();
> }
> \`\`\`
> 
> 
> \### Note
> 
> There is still some feedback left on these implementations that have yet to be applied, the intent of this RFC is to really focus on the end user usage, not collect feedback on the Pull Request itself. If you do want to give feedback about code quality, feel free to leave that feedback on the PR:
> 
> \#3

Thanks.

---

<div class="post-metadata">

**Author:** ![phillip\_pan](https://avatars.discourse-cdn.com/v4/letter/p/b487fb/32.png) [@phillip\_pan](https://community.prismic.io/u/phillip_pan)\
**Post date:** [July 11, 2022, 11:07am UTC](https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243/26 "2022-07-11T11:07:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [July 12, 2022, 1:18am UTC](https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243/28 "2022-07-12T01:18:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![phillip\_pan](https://avatars.discourse-cdn.com/v4/letter/p/b487fb/32.png) [@phillip\_pan](https://community.prismic.io/u/phillip_pan)\
**Post date:** [July 12, 2022, 8:46am UTC](https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243/29 "2022-07-12T08:46:01Z")

</div>

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](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/1/150931824646bd50c11ea03362b8e6f963ccc1bc.png)
3. Generate the shareable link  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/a/aac1470b05730b8380b2babacc8fd9f6cc6f1d43.png)
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).

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [July 13, 2022, 1:56am UTC](https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243/30 "2022-07-13T01:56:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kris](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@kris](https://community.prismic.io/u/kris)\
**Post date:** [July 19, 2022, 11:00am UTC](https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243/31 "2022-07-19T11:00:15Z")

</div>

@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

[Next page](https://community.prismic.io/t/unable-to-view-sharable-link-to-a-non-prismic-user/3243.md?page=2)
