# Embedding not allowed using v3 viewer

**URL:** <https://discourse.mcneel.com/t/embedding-not-allowed-using-v3-viewer/150625>\
**Category:** ShapeDiver\
**Tags:** mac, shapediver\
**Created:** [November 15, 2022, 10:31am UTC](https://discourse.mcneel.com/t/embedding-not-allowed-using-v3-viewer/150625 "2022-11-15T10:31:52Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ste\_1993](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ste_1993/32/344471_2.png) [@Ste\_1993](https://discourse.mcneel.com/u/Ste_1993)\
**Post date:** [November 15, 2022, 10:31am UTC](https://discourse.mcneel.com/t/embedding-not-allowed-using-v3-viewer/150625/1 "2022-11-15T10:31:52Z")

</div>

Hi, I’ve a problem embedding my model using the v3 version of the viewer.  
The viewer report “Embedding not allowed for origin [http://localhost:63342](http://localhost:63342)” even if the domain is whitelisted.  
Using the version v2 of the viewer this problem is not present.  
Do you have any suggestion?

---

<div class="post-metadata">

**Author:** ![mathieu1](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/mathieu1/32/491677_2.png) [@mathieu1](https://discourse.mcneel.com/u/mathieu1)\
**Post date:** [November 17, 2022, 8:38am UTC](https://discourse.mcneel.com/t/embedding-not-allowed-using-v3-viewer/150625/2 "2022-11-17T08:38:03Z")

</div>

I checked the list of domains whitelisted for your user and I do not see localhost:63342 (I see localhost with different ports though). Please add exactly the domain with port and let me know if it fixes the issue.

---

<div class="post-metadata">

**Author:** ![Ste\_1993](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ste_1993/32/344471_2.png) [@Ste\_1993](https://discourse.mcneel.com/u/Ste_1993)\
**Post date:** [November 17, 2022, 8:43am UTC](https://discourse.mcneel.com/t/embedding-not-allowed-using-v3-viewer/150625/3 "2022-11-17T08:43:04Z")

</div>

Hi Mathieu,  
I don’t know why you haven’t seen localhost in my domains whiteisted but this is what I’ve set in my setting and it works on the version v2 but it doesn’t work on the v3 version.  
There is another way to set the domains?

 ![Screenshot 2022-11-17 alle 09.40.39](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/6/e/9/6e935a88f948f3b84f3bbd18a2f0f8acf5ea4794.png)

---

<div class="post-metadata">

**Author:** ![mathieu1](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/mathieu1/32/491677_2.png) [@mathieu1](https://discourse.mcneel.com/u/mathieu1)\
**Post date:** [November 17, 2022, 9:13am UTC](https://discourse.mcneel.com/t/embedding-not-allowed-using-v3-viewer/150625/4 "2022-11-17T09:13:09Z")

</div>

My apologies, I had made a wrong manipulation, the domain is listed correctly. I could embed one of your models locally on this port without issues with viewer 3, could you maybe share the code you are using for embedding so we can investigate the issue?

---

<div class="post-metadata">

**Author:** ![Ste\_1993](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ste_1993/32/344471_2.png) [@Ste\_1993](https://discourse.mcneel.com/u/Ste_1993)\
**Post date:** [November 17, 2022, 9:32am UTC](https://discourse.mcneel.com/t/embedding-not-allowed-using-v3-viewer/150625/5 "2022-11-17T09:32:34Z")

</div>

I’ve just copy-pasted the first step I’ve found on the migration guide.  
This is what I’ve got so far:

index.html

```auto
<!DOCTYPE html>
<html lang="it">
<head>
    <title>ShapeDiver Sandbox</title>
    <meta charset="UTF-8" />
</head>

<body>
<div style="width: 100%; height: 100%;">
    <canvas id="canvas"></canvas>
</div>
<script src="https://viewer.shapediver.com/v3/2.3.5/bundle.js"></script>
<script type="module" src="src/index.js"></script>
</body>
</html>

```

index.ts

```auto
const SDV = (<any>window).SDV;

(async () => {
    // create a viewport
    const viewport = await SDV.createViewport({
        canvas: document.getElementById("canvas"),
        id: "myViewport"
    });
    // create a session
    const session = await SDV.createSession({
        ticket: "498016a05183498996efc757969a690c91c2df294c2d157b4cb853277aebfebb7c173d42b666e79f34829192add0e52104080fb079490cf15fd4ecb451a56ec2ea62cdc8986da9cac3ac03213ab00dcfa1faaf7447a72d040ee3af1e7b1ef970bd1d6f68319415dc244f395967f66c44162f09ea3096a949-81c40e79bbf81d05f6f66c24a4a98950",
        modelViewUrl: 'eu-central-1',
        id: "mySession"
    });
})();

```

and this is the result in the browser:

 ![Screenshot 2022-11-17 alle 10.31.52](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/3/4/3/3439892e80264658f5625a2c9919630ddbe4ab83.png)

---

<div class="post-metadata">

**Author:** ![mathieu1](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/mathieu1/32/491677_2.png) [@mathieu1](https://discourse.mcneel.com/u/mathieu1)\
**Post date:** [November 17, 2022, 9:34am UTC](https://discourse.mcneel.com/t/embedding-not-allowed-using-v3-viewer/150625/6 "2022-11-17T09:34:25Z")

</div>

Are you sure you are spinning your local server on the right port? I see 63343 in your screenshot…

---

<div class="post-metadata">

**Author:** ![Ste\_1993](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ste_1993/32/344471_2.png) [@Ste\_1993](https://discourse.mcneel.com/u/Ste_1993)\
**Post date:** [November 17, 2022, 9:40am UTC](https://discourse.mcneel.com/t/embedding-not-allowed-using-v3-viewer/150625/7 "2022-11-17T09:40:32Z")

</div>

Sorry I’ve changed the configuration of the IDE for another project, I’ve updated the whitelisted domains and the error still occurs.  
I’ve also tested the viewer on the staging part of the website. In the same scenario the viewer v2 works but the code I’ve just posted return me this message again.

 ![Screenshot 2022-11-17 alle 10.37.46](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/5/a/1/5a17da1746ef0bfec06993d01c3c4b64dccfffad.png)

---

<div class="post-metadata">

**Author:** ![mathieu1](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/mathieu1/32/491677_2.png) [@mathieu1](https://discourse.mcneel.com/u/mathieu1)\
**Post date:** [November 17, 2022, 9:44am UTC](https://discourse.mcneel.com/t/embedding-not-allowed-using-v3-viewer/150625/8 "2022-11-17T09:44:55Z")

</div>

Could you try to edit a property of the model you are trying to embed (any property, for example its name or a viewer setting), then save it and try again embedding? If that doesn’t work, I would need the url of the model you are trying to embed so that our development team can investigate on their side.

---

<div class="post-metadata">

**Author:** ![Ste\_1993](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ste_1993/32/344471_2.png) [@Ste\_1993](https://discourse.mcneel.com/u/Ste_1993)\
**Post date:** [November 17, 2022, 9:56am UTC](https://discourse.mcneel.com/t/embedding-not-allowed-using-v3-viewer/150625/9 "2022-11-17T09:56:05Z")

</div>

Can I edit the property directly from Shapediver or I have to re-upload the file completely?  
I’m asking this because I’ve already made a change from the viewer online and save it.  
I’ve also tested the v3 viewer with 3 different grasshopper files we have uploaded on Shapediver but no one works with the v3 viewer.

This is the link of one of our products: [ShapeDiver](https://www.shapediver.com/app/m/anellocamiv4).  
I’m available if you need anything else.

---

<div class="post-metadata">

**Author:** ![mathieu1](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/mathieu1/32/491677_2.png) [@mathieu1](https://discourse.mcneel.com/u/mathieu1)\
**Post date:** [November 17, 2022, 11:06am UTC](https://discourse.mcneel.com/t/embedding-not-allowed-using-v3-viewer/150625/10 "2022-11-17T11:06:03Z")

</div>

The viewer 3 only works with the exact model view url you get from the model view page. You are using a legacy model view url which only works with the viewer 2. Please copy paste the url you get straight from the platform instead:

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/2/e/b/2eb43fde28560365fb1c265d2f2b3367d0ad7286.png)

---

<div class="post-metadata">

**Author:** ![Ste\_1993](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ste_1993/32/344471_2.png) [@Ste\_1993](https://discourse.mcneel.com/u/Ste_1993)\
**Post date:** [November 17, 2022, 11:15am UTC](https://discourse.mcneel.com/t/embedding-not-allowed-using-v3-viewer/150625/11 "2022-11-17T11:15:10Z")

</div>

```auto
const SDV = (<any>window).SDV;

(async () => {
    // create a viewport
    const viewport = await SDV.createViewport({
        canvas: document.getElementById("canvas"),
        id: "myViewport"
    });
    // create a session
    const session = await SDV.createSession({
        ticket: "e1987b8c43bef3200bc47005bc2bbe2f28f22263e0845f42310e67091c6d9b2f9fe3d633971ab95a16bdfec53940b28ba0cefe0a62c49d8de8977e76669668d534d8d2c6f8f7072df2b9c46f649e52135f9f835adb6200792624df97cf749b8a43edbff0ffbf49-2b250981953e59f3b663ff8740537a35",
        modelViewUrl: 'https://sdeuc1.eu-central-1.shapediver.com',
        id: "mySession"
    });
})();

```

I’ve changed it as you suggested.  
Same error, nothing changes.

 ![Screenshot 2022-11-17 alle 12.12.02](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/7/f/d/7fd32e928be57b3d94a117b1e1e169f07b9e2f82.png)

I’ve also tried change the ticket\_id using the backend access but I’ve had no luck.

---

<div class="post-metadata">

**Author:** ![snabela](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/snabela/32/502261_2.png) [@snabela](https://discourse.mcneel.com/u/snabela)\
**Post date:** [November 17, 2022, 12:05pm UTC](https://discourse.mcneel.com/t/embedding-not-allowed-using-v3-viewer/150625/12 "2022-11-17T12:05:34Z")

</div>

@Ste_1993 we have checked the precise configuration of your model on our backend system, and it all looks good. The reason for this problem is most probably somehow related to specifics in your application. Please share the complete example, ideally using a link that we can access to reproduce the problem. If you do not want to share the link here in the forum, please send a PM.

---

<div class="post-metadata">

**Author:** ![Ste\_1993](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ste_1993/32/344471_2.png) [@Ste\_1993](https://discourse.mcneel.com/u/Ste_1993)\
**Post date:** [November 17, 2022, 1:35pm UTC](https://discourse.mcneel.com/t/embedding-not-allowed-using-v3-viewer/150625/13 "2022-11-17T13:35:33Z")

</div>

Hi Alexander,  
I’ve rebuild from scratch the backend of my integration and I’m now it seems able to make the v3 viewer works.  
I really don’t know how it was possible. I will spend the afternoon investigate on it.  
I will post anything i will find.  
Thanks for the support.
