Generating unique slugs via the API and the need for external slugifier and API requests.

3 replies
Last updated: Jul 17, 2023
Hi everyone - another question that I hope you can help with 🙂Is it possible to generate a unique slug (making sure it’s unique) via the API using some out-of-the-box functionality, a library or plugin?
Or would I need to build/find an external slugifier, make an API request to check that it’s unique, and then a request to insert/update the document?
Jul 17, 2023, 6:20 PM
You’d need to go with the latter option 🙂
Jul 17, 2023, 7:21 PM
Thank you! 🙂
Jul 17, 2023, 7:22 PM
You’re welcome!
Jul 17, 2023, 7:23 PM

Sanity– build remarkable experiences at scale

The Sanity Composable Content Cloud is the 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?

Categorized in