import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
sanity: {
type: "app",
app: "sanity",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://${this.sanity.$auth.project_id}.api.sanity.io/v2021-06-07/data/query/production`,
headers: {
Authorization: `Bearer ${this.sanity.$auth.api_token}`,
},
params: {
query: `*`,
},
})
},
})
Emit new event when a new document is created. See the documentation
Sanity uses API keys for authentication. When you connect your Sanity account, Pipedream securely stores the keys so you can easily authenticate to Sanity APIs in both code and no-code steps.