😎 Discover cool tips and tricks for customization in our next Developer Deep Dive virtual event - sign up now!

How to generate a document with code with an custom inputComponent?

5 replies
Last updated: Sep 24, 2020
Hello! i am trying to generate a document with code with an custom inputComponent, is it possible? can anyone guide me a little?
Sep 24, 2020, 9:44 AM
You can use the sanity client to create one
import client from 'part:@sanity/base/client'

client.create({_type: 'whatever', yourfields... })
Sep 24, 2020, 10:29 AM
wow πŸ˜„ thanks a lot, will give it a try right now!
Sep 24, 2020, 10:30 AM
let me know if it works or not, I typed it from memory so could be a different method name or something πŸ˜…
Sep 24, 2020, 10:33 AM
Of course! now i know where i can take a look at) will come back here and let you know
Sep 24, 2020, 10:33 AM
user G
Got it working! your code by memory was perfect πŸ˜„ so happy with this
Sep 24, 2020, 12:26 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?