{"id":28273042,"url":"https://github.com/zesty-io/fetch-page","last_synced_at":"2026-06-15T16:32:02.478Z","repository":{"id":183692494,"uuid":"634959749","full_name":"zesty-io/fetch-page","owner":"zesty-io","description":"NPM Javascript package for fetching JSON data of a Zesty.io CMS page","archived":false,"fork":false,"pushed_at":"2023-05-01T18:16:28.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-09T00:45:33.444Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zesty-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-05-01T16:39:38.000Z","updated_at":"2023-05-01T17:03:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"37b0ea87-0378-4745-abc9-8008dbf72d6e","html_url":"https://github.com/zesty-io/fetch-page","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"7a80ce5eff379311aa50fcdb0ef97e67418ac1c6"},"previous_names":["zesty-io/fetch-page"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zesty-io/fetch-page","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesty-io%2Ffetch-page","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesty-io%2Ffetch-page/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesty-io%2Ffetch-page/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesty-io%2Ffetch-page/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zesty-io","download_url":"https://codeload.github.com/zesty-io/fetch-page/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesty-io%2Ffetch-page/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34372121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"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":"2025-05-21T00:17:10.058Z","updated_at":"2026-06-15T16:32:02.469Z","avatar_url":"https://github.com/zesty-io.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fetch-page\nNPM Javascript package for fetching JSON data of a Zesty.io CMS page\n\n# How to Install\n\nInstall from NPM or Yarn\n\n```\nnpm install @zesty-io/fetch-page\n```\n\n# How to Use\n\nFetch page requires on the url of the page you're fetching data for and an env value with  Zesty Config JSON object. Having access to the URL from `window.location.pathname` or your routing middle ware is neccesary to feed the function. \n\nZesty config value in your ENV are a requirement. An Example of the Zesty.io JSON object is below, you may also copy the JSON file from the `examples` folder. This value must be stringfied when it is saved. \n\n```\n{\n  \"instance_zuid\": \"8-xyzxyz-7xyzxy\",\n  \"stage\": \"https://xyz-dev.webengine.zesty.io\",\n  \"production\": \"https://www.myproductiondomain.com\",\n  \"stage_password\": \"\",\n  \"auth\": \"\",\n  \"src_dir\": \"\",\n  \"options\": {\n    \"skip_config_overwrite\": false,\n    \"model_ignore_list\": [\"6-xyz\"]\n  },\n  \"runinstaller\": true\n}\n```\n\n## App.js Example\n\nImport fetchPage into your App.js \n\n```\nimport React from 'react';\nimport { fetchPage } from '@zesty-io/fetch-page';\n```\n\nIn your App.js function, use setState and useEffect hooks to access the data\n\n```\nimport './App.css';\nimport React from 'react';\nimport { fetchPage } from '@zesty-io/fetch-page';\n\nfunction App() {\n  const [content, setContent] = React.useState({ title: 'missing'});\n\n  React.useEffect(() =\u003e {\n    // declare the data fetching function\n    const fetchData = async () =\u003e {\n      setContent(await fetchPage(window.location.pathname));\n    }\n  \n    // call the function\n    fetchData();\n  }, [])\n\n\n  return (\n    \u003cdiv className=\"App\"\u003e\n      {content?.title \u0026\u0026 \u003ch1\u003e{content.title}\u003c/h1\u003e}\n    \u003c/div\u003e\n  );\n}\n\nexport default App;\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzesty-io%2Ffetch-page","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzesty-io%2Ffetch-page","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzesty-io%2Ffetch-page/lists"}