πŸ‘€ Our most exciting product launch yet πŸš€ Join us May 8th for Sanity Connect

How to Tell which Dataset you're in within a Custom Action

2 replies
Last updated: Oct 31, 2020
Good morning I was wondering is there a way within a custom action to tell in which dataset I'm in? (using the experimental feature for the spaces)
Oct 31, 2020, 12:12 PM
I guess you could get it from the client

import client from "part:@sanity/base/client"

const {dataset} = client.config()
Oct 31, 2020, 1:03 PM
Perfect thanks!!
Oct 31, 2020, 1:16 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?