Discussion on setting the Sanity API version for stability

5 replies
Last updated: Jun 15, 2023
This message was deleted.
user Q
Please help us out by threading your posts.
I have figure it out set the value of the Sanity API version to 1 instead of the current date. When using version 1 app won’t work correctly. Is there like a stable version instead of setting the current date?
A detailed perspective on the versioning system can be found here: https://www.sanity.io/docs/api-versioning
Speaking only for myself, my advice would be to accommodate the more advanced/recent API within your project if possible rather than pulling back the version to match, if the goal is stability.
Yes thanks. I have found that but I don't see how to set a stable version only option to set the date.
The dates are stable versions. We use versioning inspired by Stripe, as mentioned in the docs Vincent linked to. Setting
v2023-06-15
will continue to use the API as it existed on that date, even if there are breaking changes on 2023-06-16.

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?