{"id":22122094,"url":"https://github.com/remotesynth/stepzen-content-pull","last_synced_at":"2025-09-05T00:49:58.880Z","repository":{"id":48353307,"uuid":"382444833","full_name":"remotesynth/stepzen-content-pull","owner":"remotesynth","description":"A POC for pulling content locally from any stepzen endpoint","archived":false,"fork":false,"pushed_at":"2021-08-30T14:29:26.000Z","size":45,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-31T23:58:32.604Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/remotesynth.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":"2021-07-02T19:33:42.000Z","updated_at":"2021-07-30T19:56:00.000Z","dependencies_parsed_at":"2022-08-26T04:43:44.559Z","dependency_job_id":null,"html_url":"https://github.com/remotesynth/stepzen-content-pull","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/remotesynth/stepzen-content-pull","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remotesynth%2Fstepzen-content-pull","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remotesynth%2Fstepzen-content-pull/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remotesynth%2Fstepzen-content-pull/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remotesynth%2Fstepzen-content-pull/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remotesynth","download_url":"https://codeload.github.com/remotesynth/stepzen-content-pull/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remotesynth%2Fstepzen-content-pull/sbom","scorecard":{"id":770469,"data":{"date":"2025-08-11","repo":{"name":"github.com/remotesynth/stepzen-content-pull","commit":"67c4971c01b3116b7af4bf32487cbbd2dbb39ca6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 1/24 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T02:06:42.332Z","repository_id":48353307,"created_at":"2025-08-23T02:06:42.332Z","updated_at":"2025-08-23T02:06:42.332Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273612486,"owners_count":25136980,"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","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-12-01T15:17:20.814Z","updated_at":"2025-09-05T00:49:53.866Z","avatar_url":"https://github.com/remotesynth.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StepZen Content Pull for Jamstack Sites\n\n```bash\nnpx @remotesynth/stepzen-content-pull\n```\n\nThis project is aimed at making it easier to pull content from any source hooked into your [StepZen GraphQL API](https://stepzen.com) and convert that into file-based resources that can be processed at build time in any static site generator. While this can work with any SSG, it is especially useful for ones that do not have a built-in means to call an API directly during the build.\n\nThis can be combined with the [StepZen Netlify Build Plugin](https://stepzen.com/docs/connecting-frontends/netlify-build-plugin) to create a build workflow that automatically pulls new content from the API whenever a build is process. (See [this tutorial](https://www.netlify.com/blog/2021/06/10/how-to-build-a-database-driven-jamstack-site/) on Netlify's blog for a general idea of how this workflow could be set up).\n\n## Configuration\n\nThis library requires two things to function:\n\n1. A `.env` file containing your `STEPZEN_API_KEY` or your API key passed via the `--apikey` flag. Your API key can be found on your [StepZen account page](https://stepzen.com/account). Note, it does not require the Admin Key, just the standard API Key.\n2. A `config.js` file laying out the queries from which content will be generated. You can see an example file in `example.config.js`. More details on this file are below.\n\n### config.js\n\nThe `config.js` file is loaded in at runtime as a module. The module must export a JavaScript object with the following properties:\n\n* `account_name` - This is your StepZen account name that can be found on your [StepZen account page](https://stepzen.com/account).\n* `endpoint` - This is the folder name and endpoint name that you supplied when deploying your API to StepZen (for example, using `stepzen start`). It should be in the format `folder_name/endpoint_name`. This, combined with the `account_name` will determine the endpoint URL. For example, if my account name is `brian` and the `endpoint` is `api/foobar`, then all the queries will be run against `https://brian.stepzen.net/api/foobar/__graphql`.\n* `queries` - This is an array of all of the queries that you would like to be converted to file-based content. There are different properties that need to be passed depending on the type of files you'd like the resulting data to be converted to.\n\n### `queries` Configuration\n\nThere are four types of files that can be converted. The configuration for the `queries` array can differ somewhat for each. However, the following values are required for every type:\n\n* `query` - This is the GraphQL query that will be sent to the endpoint.\n* `convert_to` - This is the file name or file type you want to convert the data to. For single files like JSON/YAML data files, you would like the full file name (i.e. `mydata.json` or `mydata.yaml`). This also applies to single Markdown files (i.e. `about.md` or `about.markdown`) that you do not want to generate a slug for. For an array of items to be converted to Markdown, you only need to supply the file extension (i.e. `.md` or `.markdown`). The tool does not yet support looping through a result and writing unique data files. For YAML or JSON, the full results are converted and written as a single data file.\n* `folder` - This is the relative path to the folder within your project that the file should be written to. For example, a value of `_posts` will write the `/_posts` folder within your project. An empty value will write the files to the root directory of your project.\n* `root_node` - Some queries don't return the data you want to convert in the root of the query result. You can use `root_node` to flatten the results to properly convert to JSON, YAML or Markdown that you need. For example, a query may return items under an `edges` array and then each result under a `node` object within each array item. You can specify `root_node: 'edges[].node` in order to flatten the object in a way that will properly convert each item into Markdown.\n\n#### 1. Converting to JSON\n\nThe query response can be written directly to a JSON file. There are no additional fields required for writing to JSON.\n\n#### 2. Converting to YAML\n\nThe query response can be converted to YAML using [js-yaml](https://www.npmjs.com/package/js-yaml). There are no additional fields required for writing to YAML.\n\n#### 3. Converting to a single Markdown file\n\nThe result of the query should be a single item, not an array of items. The following fields are also available:\n\n* `slug_field` (optional) - This is a field in the query that you would like converted to a slug (ex. \"About Us\" to `about-us.md`). If this field is not present, the value of `convert_to` should be the full file name. If this value is included, the value of `convert_to` should be either `.md` or `.markdown`.\n* `body_field` (required) - This is the field that will populate the body of the Markdown file. Every other field returned by the query will be converted to YAML and placed within the frontmatter.\n* `additional_frontmatter` (optional) - This is a JavaScript object representing additional fields that will be written as YAML in each files frontmatter. In some cases, you'll want to add additional frontmatter fields to every result returned by the query. For example, some SSGs require that you specify a `layout` value, so you might have `layout: 'page'` as part of this object.\n\n#### 4. Converting to a multiple Markdown files\n\nThe result of the query should be an array of items. The following fields are also available:\n\n* `slug_field` (required) - This is a field in the query that you would like converted to a slug (ex. \"My First Post\" to `my-first-post.md`). This is required for multiple Markdown files as each item is generated with a unique file name. The value of `convert_to` should be either `.md` or `.markdown`.\n* `body_field` (required) - This is the field that will populate the body of each Markdown file. Every other field returned by the query will be converted to YAML and placed within the frontmatter.\n* `additional_frontmatter` (optional) - This is a JavaScript object representing additional fields that will be written as YAML in each files frontmatter. In some cases, you'll want to add additional frontmatter fields to every result returned by the query. For example, some SSGs require that you specify a `layout` value, so you might have `layout: 'post'` as part of this object.\n\n## Running the Script\n\nYou can run the content pull via:\n\n```bash\nnpx @remotesynth/stepzen-content-pull\n```\n\nYou'll need to have a `config.js` in the folder you are running in as well as a `.env` with your `STEPZEN_API_KEY`. Alternatively, you can specify a different config using the `--config` flag. For example:\n\n```bash\nnpx @remotesynth/stepzen-content-pull --config \"configs/content-pull-confg.js\"\n```\n\nOr you can pass an API key via the `--apikey` flag.\n\n```bash\nnpx @remotesynth/stepzen-content-pull --apikey \"my-api-key\"\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremotesynth%2Fstepzen-content-pull","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremotesynth%2Fstepzen-content-pull","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremotesynth%2Fstepzen-content-pull/lists"}