Speckle stream in Rhino Compute - How to get proper model URL?

Hi,

I’m working on integrating Speckle viewer to my webpage, that was previously a fork of rhino compute appserver.

The idea behind this is that i want my users to modify settings, then rhino.compute processes the data, modifies the output, and i then want to display the output with the changed configuration.

I started from the Advanced Setup here and it kind of works, except that i have to enter manually the URL:

When i try with either one of the two URLS shown below, it doesn’t get past the const urls = await UrlHelper.getResourceUrls(url, authToken); line.

Notice that the structure is different from the one that is suggested in the viewer sample.
https://app.speckle.systems/projects/c7eaxxxxxx/models/c262xxxxxx

To get into more details, for the two URLS shown in the screenshot, when i open them in the browser:

  • The first one redirects me to the right model page, but doesnt get past the UrlHelper.getResourceUrls
  • The second one only takes me to the project, not the model. It seems to be missing an argument.

Am i missing something? Getting from the start, what would be the best way to collect the URL to request in my webapp from Grasshopper model?

Thanks in advance

Hey! Thanks for the detailed context. You’re absolutely on the right track, and you’ve pinpointed the core of the issue: legacy vs. next-gen URL schemas. refer: The Great Rename

Grasshopper v2 (which you’re using) still outputs legacy-style Speckle stream URLS — like the ones you see in your screenshot:

  • https://app.speckle.systems/streams/c7ea.../commits/34524b...legacy commit URL
  • https://app.speckle.systems/projects/c7ea.../models/..... ← newer URL scheme

Whereas the Viewer API in the Speckle Advanced Setup expects:
https://app.speckle.systems/projects/{projectId}/models/{modelId}
Or to load a specific version:
https://app.speckle.systems/projects/{projectId}/models/{modelId}@{versionId}

To use UrlHelper.getResourceUrls(url, authToken) successfully, make sure your URL is in the next-gen format and includes both the project and model ID.

So you’ll need to extract the modelId as well, either:

  1. Manually (for now) — open the project page, copy the full model link from the UI.
  2. Programmatically (ideal) — but that’ll require modifying your GH script to output project and model IDs using next-gen naming.

Since your current GH script outputs legacy URLS, you can:

  • Parse the commit URL (which contains the stream ID and commit ID),
  • And convert it into the newer structure with:
    https://app.speckle.systems/projects/{streamId}/models/{modelId}

But here’s the catch: You also need the modelId, which is not included in first commit URL. So… a bit of text manipulation might be required.

The upcoming Grasshopper connector (new gen) will deprecate streams, branches, commits entirely. Instead, it will directly operate on:

  • Projects
  • Models
  • Versions

So once that’s in your hands, this will be seamless — GH will return viewer-ready URLS directly.


TL;DR

  • You’re seeing legacy URLS; the viewer expects next-gen.
  • You need to obtain the model ID.
  • Best practice = use the new URL pattern: https://app.speckle.systems/projects/{projectId}/models/{modelId}
  • You can manually look it up for now or query the API.
  • Future GH connector will make this native.

Hi again @jonathon and thanks for the feedback.

Thing is, as you see above i have 3 URL:

  • First url coming from Synchronous Sender component
  • Second coming from Create Stream Component
  • Third one coming from Copy pasting the second one in the browser then clicking on the first model

I don’t see how i can parse the modelId, even with text manipulation which would not be an issue, since it’s nowhere to be found in either one of the two URLs.