{"id":15290444,"url":"https://github.com/stackbit/sourcebit-sample-plugin","last_synced_at":"2025-07-05T06:35:18.592Z","repository":{"id":49675830,"uuid":"233865576","full_name":"stackbit/sourcebit-sample-plugin","owner":"stackbit","description":"A sample source plugin for Sourcebit","archived":false,"fork":false,"pushed_at":"2021-06-10T23:42:36.000Z","size":142,"stargazers_count":12,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T01:35:50.819Z","etag":null,"topics":["headless","headless-cms","jamstack","sourcebit"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/sourcebit-sample-plugin","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}},"created_at":"2020-01-14T14:56:06.000Z","updated_at":"2023-06-29T04:53:38.000Z","dependencies_parsed_at":"2022-07-31T16:49:01.152Z","dependency_job_id":null,"html_url":"https://github.com/stackbit/sourcebit-sample-plugin","commit_stats":null,"previous_names":["stackbithq/sourcebit-sample-plugin"],"tags_count":1,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbit%2Fsourcebit-sample-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbit%2Fsourcebit-sample-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbit%2Fsourcebit-sample-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackbit%2Fsourcebit-sample-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackbit","download_url":"https://codeload.github.com/stackbit/sourcebit-sample-plugin/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":["headless","headless-cms","jamstack","sourcebit"],"created_at":"2024-09-30T16:08:12.588Z","updated_at":"2025-04-13T10:12:00.959Z","avatar_url":"https://github.com/stackbit.png","language":"JavaScript","readme":"# sourcebit-sample-plugin\n\n[![npm version](https://badge.fury.io/js/sourcebit-sample-plugin.svg)](https://badge.fury.io/js/sourcebit-sample-plugin)\n\n\u003e A sample plugin for [Sourcebit](https://github.com/stackbithq/sourcebit)\n\n## 👩‍🏫 Introduction\n\nThis is a simple Sourcebit plugin for development and educational purposes. It retrieves entries from a remote API located at [https://jsonplaceholder.typicode.com/](https://jsonplaceholder.typicode.com/). If the `watch` option is supplied, one of the entries will be randomly picked every 3 seconds and a string containing `\"(updated)\"` will be appended to the `body` field.\n\nFor details on how Sourcebit plugins work and the requirements for creating a new plugin, please check out [contribution guidelines](https://github.com/stackbithq/sourcebit/blob/master/CONTRIBUTING.md#creating-a-plugin).\n\n**For a step-by-step walkthrough on building a Sourcebit plugin, check out our tutorial at: \u003chttps://www.stackbit.com/blog/sourcebit-plugin/\u003e**\n\n## 🏗 Installation\n\nTo install the plugin and add it to your project, run:\n\n```\nnpm install sourcebit-sample-plugin --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| `mySecret`  | String  | **Private** |               | `MY_SECRET`  |           | A secret value. Not actually used by the plugin, purely for demonstration purposes. |\n| `watch`     | Boolean | Public      | `false`       |              | `watch`   | Whether to update entries on a regular interval.                                    |\n| `titleCase` | Boolean | Public      | `false`       |              |           | Whether to convert the value of the `title` field to title-case                     |\n\n### 👀 Example configuration\n\n_sourcebit.js_\n\n```js\nmodule.exports = {\n    plugins: [\n        {\n            module: require('sourcebit-sample-plugin'),\n            options: {\n                titleCase: true\n            }\n        }\n    ]\n};\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 and normalized model objects to the `models` data bucket.\n\n## 👷🏻‍♀️ Development\n\nThe `example` directory contains a basic installation of Sourcebit with this sample plugin installed and configured. It's a good way to develop a plugin locally.\n\nTo run it, run:\n\n```shell\ncd example\nnpm install\n\n# Run Sourcebit in the command-line\nnpm run sourcebit-cli\n\n# Run Sourcebit in a Node.js application\nnpm run sourcebit-node\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackbit%2Fsourcebit-sample-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackbit%2Fsourcebit-sample-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackbit%2Fsourcebit-sample-plugin/lists"}