✨Discover storytelling in the AI age with Pixar's Matthew Luhn at Sanity Connect, May 8th—register now

Discussion about API versioning in the Vision plugin and the confusion around stable vs experimental versions.

15 replies
Last updated: Sep 9, 2021
Is there a reason the API version numbers in the Vision plugin don’t match the numbers specified here: https://www.sanity.io/docs/api-versioning . Maybe I’m missing something?
Sep 8, 2021, 7:32 PM
Oh ok, I think I understand.v1 = outdated
vX = current, most recent

Is there a reason v2021-03-25 is there? Is that also essentially v1?
Sep 8, 2021, 7:47 PM
I missed the experimental section of that page, thx for the help!
Sep 8, 2021, 7:49 PM
vX is the experimental version that's likely to change or be unstable. So proceed with caution! The v2021-03-25 version will be your best bet in terms of getting the most recent, stable version.
Sep 8, 2021, 7:50 PM
Thats the version that follows the date incremented version numbers that we use now.
Sep 8, 2021, 7:51 PM
Oh ok, where do we following what is considered the most recent stable version?
I thought the current stable is what was listed at the top of
https://www.sanity.io/docs/api-versioning#71d69d9f4146 . For instance, currently
v2021-06-07
Sep 8, 2021, 7:52 PM
Ah, yeah I see how that's confusing. Using v2021-03-25 in Vision will be what you want. On your frontend when configuring a client you'd use the current date to make sure you're getting the right one. We'll add in a note to the docs to make that more clear!
Sep 8, 2021, 8:06 PM
Sorry, I’m not sure I follow 😞. If v2021-03-25 is the most recent stable, and we’re recommended to use the current date (such as today), would we be getting v2021-06-07 or v2021-03-25?
Is v2021-06-07 the most recent experimental version and v2021-03-25 is the most recent stable?
Sep 8, 2021, 8:18 PM
Sorry, let me see if I can clarify: using v2021-06-07, for example, would use the most recent, stable API version released on or before June 7, 2021. v2021-03-25 would would use the most recent, stable API version released on or before March 25, 2021. You'll only end up using an experimental version if you use vX.
Sep 8, 2021, 8:49 PM
I think the reason it's a bit confusing is that the version number notation is "overloaded"; it's used both in a "filter" capacity in the URL, where it means " give me the most recent <= {date}", and as names for actual versions, where it means "the version released at {date}" :)
Sep 8, 2021, 9:05 PM
In this particular case, both v2021-03-25 and v2021-06-07 requests result in the actual version v2021-03-25 (since there's no newer stable version)
Sep 8, 2021, 9:07 PM
In this particular case, both v2021-03-25 and v2021-06-07 requests result in the actual version v2021-03-25 (since there's no newer stable version)
Sep 8, 2021, 9:07 PM
Ah right, thank you both! I think my confusion came from the docs. I thought there was some relevance to the date of v2021-06-07 but it sounds like that was just an arbitrary date example. The reason I made this thread originally was because the Vision plugin explicitly references v2021-03-25, but the docs reference v2021-06-07 (the arbitrary example date).
Sep 8, 2021, 9:11 PM
Thanks again!!
Sep 8, 2021, 9:12 PM
I have this confusion everytime, may be add some info in brackets?
Sep 9, 2021, 3:48 PM
eg:vX (beta)v2021-03-25 (latest, stable)
v1 (old)
Sep 9, 2021, 3:49 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?