{"id":15290438,"url":"https://github.com/stackbit/sourcebit-source-sanity","last_synced_at":"2025-04-13T10:11:45.384Z","repository":{"id":37856057,"uuid":"237239022","full_name":"stackbit/sourcebit-source-sanity","owner":"stackbit","description":"A Sanity source plugin for Sourcebit","archived":false,"fork":false,"pushed_at":"2023-03-03T14:16:11.000Z","size":1086,"stargazers_count":4,"open_issues_count":17,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-21T05:04:11.810Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/sourcebit-source-sanity","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackbit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-30T15:09:09.000Z","updated_at":"2022-05-15T09:56:38.000Z","dependencies_parsed_at":"2024-09-30T16:08:14.269Z","dependency_job_id":"d2d6a028-ebf2-4b82-8864-120d32d8bbb7","html_url":"https://github.com/stackbit/sourcebit-source-sanity","commit_stats":{"total_commits":56,"total_committers":8,"mean_commits":7.0,"dds":0.2857142857142857,"last_synced_commit":"7ff2445a534bbcd1cc97bf9579de22cf895c9939"},"previous_names":["stackbithq/sourcebit-source-sanity"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbit%2Fsourcebit-source-sanity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbit%2Fsourcebit-source-sanity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbit%2Fsourcebit-source-sanity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbit%2Fsourcebit-source-sanity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackbit","download_url":"https://codeload.github.com/stackbit/sourcebit-source-sanity/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248695481,"owners_count":21146956,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-30T16:08:11.386Z","updated_at":"2025-04-13T10:11:45.364Z","avatar_url":"https://github.com/stackbit.png","language":"JavaScript","readme":"# sourcebit-source-sanity\n\n![Node CI](https://github.com/stackbithq/sourcebit-source-sanity/workflows/Node%20CI/badge.svg?branch=master)\n[![Coverage Status](https://coveralls.io/repos/github/stackbithq/sourcebit-source-sanity/badge.svg?v=20200302)](https://coveralls.io/github/stackbithq/sourcebit-source-sanity)\n[![npm version](https://badge.fury.io/js/sourcebit-source-sanity.svg)](https://badge.fury.io/js/sourcebit-source-sanity)\n\n\u003e A [Sanity](https://www.sanity.io) source plugin for [Sourcebit](https://github.com/stackbithq/sourcebit)\n\n## 👩‍🏫 Introduction\n\nWith this plugin, you can add Sanity as a data source for Sourcebit. To connect your Sanity account, you need an [API token](https://www.sanity.io/docs/http-auth), your project ID and the name of your [dataset](https://www.sanity.io/docs/datasets).\n\n## 🏗 Installation\n\nTo install the plugin and add it to your project, run:\n\n```\nnpm install sourcebit-source-sanity --save\n```\n\n\u003e 💡 You don't need to run this command if you start Sourcebit using the [interactive setup process](#%EF%B8%8F-interactive-setup-process), as the CLI will install the plugin for you and add it as a dependency to your project.\n\n## ⚙️ Configuration\n\nThe plugin accepts the following configuration parameters. They can be supplied in any of the following ways:\n\n-   In the `options` object of the plugin configuration block inside `sourcebit.js`, with the value of the _Property_ column as a key;\n-   As an environment variable named after the _Env variable_ column, when running the `sourcebit fetch` command;\n-   As part of a `.env` file, with the value of the _Env variable_ column separated by the value with an equals sign (e.g. `MY_VARIABLE=my-value`);\n-   As a CLI parameter, when running the `sourcebit fetch` command, using the value of the _Parameter_ column as the name of the parameter (e.g. `sourcebit fetch --my-parameter`).\n\n| Property               | Type    | Visibility  | Default value | Env variable          | Parameter | Description                                                                                |\n| ---------------------- | ------- | ----------- | ------------- | --------------------- | --------- | ------------------------------------------------------------------------------------------ |\n| `accessToken`          | String  | **Private** |               | `SANITY_ACCESS_TOKEN` |           | The Sanity API token.                                                                      |\n| `dataset`              | String  | Public      |               |                       |           | The name of the [dataset](https://www.sanity.io/docs/datasets).                            |\n| `isPreview`            | Boolean | Public      | `false`       |                       |           | Whether to include draft/unpublished entries.                                              |\n| `query`                | String  | Public      | `\"*[]\"`       |                       |           | The query to pass to the Sanity API.                                                       |\n| `queryParameters`      | Object  | Public      | `{}`          |                       |           | The query parameters to pass to the Sanity API.                                            |\n| `projectId`            | String  | Public      |               |                       |           | The ID of the Sanity project.                                                              |\n| `richTextOutputFormat` | String  | Public      | `html`        |                       |           | The format to convert rich-text fields to. Accepted values: `html`, `markdown` and `none`. |\n| `useCdn`               | Boolean | Public      | `false`       |                       |           | Whether to use the [Data API CDN](https://www.sanity.io/docs/api-cdn).                     |\n| `watch`                | Boolean | Public      |               |                       | `watch`   | Whether to poll Sanity for content changes.                                                |\n\n### 👀 Example configuration\n\n_sourcebit.js_\n\n```js\nmodule.exports = {\n    plugins: [\n        {\n            module: require('sourcebit-source-sanity'),\n            options: {\n                accessToken: process.env['SANITY_ACCESS_TOKEN'],\n                dataset: 'production',\n                projectId: '1q2w3e4r'\n            }\n        }\n    ]\n};\n```\n\n_.env_\n\n```\nSANITY_ACCESS_TOKEN=123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\n```\n\n### 🧞‍♂️ Interactive setup process\n\nThis plugin offers an interactive setup process via the `npx create-sourcebit` command.\n\n## 📥 Input\n\n_N/A_\n\n## 📤 Output\n\nThis plugin adds normalized entries to the `objects` data bucket.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackbit%2Fsourcebit-source-sanity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackbit%2Fsourcebit-source-sanity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackbit%2Fsourcebit-source-sanity/lists"}