How to connect an external API and show a dropdown component in Sanity.

2 replies
Last updated: Nov 28, 2023
Hello, awesome people!
I am starting a big ecom project for a famous sports brand. I have a question, we will be using Centra as our ecom engine, and would like to be able to show products and collections as part of Sanity.

Let's say for example I have a "BEST SELLING" content block. I would like to be able to select the product inside Sanity, and not have to go to Centra, get the product ID, and then copy paste that into Sanity.

If you know what I mean?

What is the best way to connect to an external API and show a dropdown component or something in Sanity? (Maybe Sanity even offers their component library for dropdowns I can reuse?)

Thank you so much!
Nov 17, 2023, 1:59 PM
Here’s a simple custom component that can do what you’re looking for!
Nov 17, 2023, 8:29 PM
user M
Thank you kindly! 🙂
Nov 28, 2023, 6:15 AM

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?