👋 Next.js Conf 2024: Come build, party, run, and connect with us! See all events

How to Add Secrets in the Studio for Instance a API Token for a Third Party Service?

3 replies
Last updated: Apr 21, 2021
So any document with a prefix with a
.
(like
draft.
) becomes private. So I have a singleton document that I use that has a document id prefix of
secret.
that I load when needed in the studio
Apr 21, 2021, 4:51 AM
So just now I was searching for the slack thread where I first found out about this. Looks like it's gone now. But did just find this which may help you https://github.com/sanity-io/sanity-studio-secrets
Apr 21, 2021, 4:53 AM
uses the same method I said
Apr 21, 2021, 4:54 AM
const id = `secrets.${namespace}`;
const query = '* [_id == $id] {secrets}[0]';
Apr 21, 2021, 4:54 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?