{"id":42589586,"url":"https://github.com/linnify/datafycms-js","last_synced_at":"2026-01-28T23:09:43.907Z","repository":{"id":57106123,"uuid":"349936122","full_name":"linnify/datafycms-js","owner":"linnify","description":"JS API Client for DatafyCMS","archived":false,"fork":false,"pushed_at":"2021-04-27T18:49:57.000Z","size":240,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-18T17:08:16.406Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.linnify.com/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linnify.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-03-21T08:09:18.000Z","updated_at":"2025-05-13T09:43:44.000Z","dependencies_parsed_at":"2022-08-20T23:20:18.414Z","dependency_job_id":null,"html_url":"https://github.com/linnify/datafycms-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/linnify/datafycms-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linnify%2Fdatafycms-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linnify%2Fdatafycms-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linnify%2Fdatafycms-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linnify%2Fdatafycms-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linnify","download_url":"https://codeload.github.com/linnify/datafycms-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linnify%2Fdatafycms-js/sbom","scorecard":{"id":591166,"data":{"date":"2025-08-11","repo":{"name":"github.com/linnify/datafycms-js","commit":"d01fc068d733e1b3dbba82d3fb698f1bfefdc38c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/13 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":"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":"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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"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: ISC 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 'main'"],"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":"Vulnerabilities","score":0,"reason":"32 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-cph5-m8f7-6c5x","Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx","Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q","Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"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-20T21:55:55.925Z","repository_id":57106123,"created_at":"2025-08-20T21:55:55.925Z","updated_at":"2025-08-20T21:55:55.925Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28854546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T22:56:21.783Z","status":"ssl_error","status_checked_at":"2026-01-28T22:56:00.861Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-01-28T23:09:43.420Z","updated_at":"2026-01-28T23:09:43.898Z","avatar_url":"https://github.com/linnify.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DatafyCMS JavaScript Client\n\n[![npm version](https://img.shields.io/npm/v/@datafycms/js-client)](https://www.npmjs.com/package/@datafycms/js-client)\n[![codecov](https://codecov.io/gh/linnify/datafycms-js/branch/main/graph/badge.svg)](https://codecov.io/gh/linnify/datafycms-js)\n[![Build Status](https://travis-ci.com/linnify/datafycms-js.svg?branch=main)](https://travis-ci.com/linnify/datafycms-js)\n\nJavaScript API Client for interacting with DatafyCMS API.\n\n## Installation\n\n#### NPM\n```angular2html\nnpm install @datafycms/js-client\n```\n\n#### YARN\n```angular2html\nyarn add @datafycms/js-client\n```\n\n## Documentation\n\nThe library is written fully in TypeScript. The SDK offers to functionalities that will \nlet you work with Collections API from DatafyCMS.\n\n1. Set up your Authentication Token\n2. Start interacting with Collections API\n\n\n### Set up the Authentication Token\n\nThere are 2 ways to set up your authentication token\n\n#### 1. Automatically\nBy default, datafyCMS will look over the `DATAFYCMS_API_TOKEN` environment variable,\nso you only need to setup your environment variable\n\n```javascript\nDATAFYCMS_API_TOKEN=\u003cYOUR_API_TOKEN_HERE\u003e\n```\n\n#### 2.Set the API Token manually\nTo set up manually the authentication token, you need to call the ``setup`` function, before\ninteracting with the main API!!.\n\n```javascript\nimport datafyCMS from '@datafycms/js-client';\n\ndatafyCMS.setup('YOUR API TOKEN HERE')\n```\n\n### Work with Collections API\n\nCollection class has the following method that can be used to build the actual request\n - `fields([field1, field2])` - list of fields\n - `filterBy(fieldId, operator: Operator, value: string | number | boolean)` -\u003e apply filtering\n - `search(searchValue: string)` -\u003e apply search\n\nTo create `Collection` instance that can work with the remote API you need to call\n\n```typescript\nconst yourCollection = datafyCMS.collections\u003cT\u003e('your collection name')\n```\n\n`T` represents the shape of your collection.\n\nTo retrieve records from a collection you need to call the `.list()` method\n\n```typescript\nconst response = await datafyCMS.collections\u003cT\u003e('your collection name')\n  .list()\n\n// The response will look like this\nexport interface Response\u003cT\u003e {\n  results: T[];\n  previous: string;\n  next: string;\n  count: number;\n}\n```\n\nTo filter the records you need to call the `filterBy` method. The `filterBy` will accept the `fieldId` an `Operator` and the value\n\nThose are all the operators that you can work with\n```typescript\nexport enum Operator {\n  EQ = 'eq',\n  GT = 'gt',\n  GTE = 'gte',\n  LT = 'lt',\n  LTE = 'lte',\n  ISNULL = 'isnull',\n  IN = 'in',\n}\n```\n\n### Work with Record\n\nTo work with a specific record and perform:\n - get\n - update\n - delete\n - publish\n - unpublish (draft mode)\n\nYou need to create a `CollectionRecord` instance. The `CollectionRecord` can be created from `Collection` instance by calling the `record` method\n\n```typescript\nconst recordIntance = datafyCMS.collections\u003cT\u003e('articls')\n  .fields(['title', 'price'])\n  .record('\u003cRECORD_ID OR ANY SLUG_FIELD_VALUE\u003e')\n```\n\nWhen you create a `CollectionRecord` from `Collection` instance all the `fields` that were set on `collection` are automatically transferred on `CollectionRecord` instance. \nYou can choose to override those by calling `fields([])` on `CollectionRecord` instance\n\nThe `CollectionRecord` instance have the following methods.\n\n```typescript\nexport class CollectionRecord\u003cT\u003e {\n  fields(fields: string[]): CollectionRecord  // Set what fields you want to get for this record\n\n  get(): Promise\u003cT\u003e                           // Getting the record from DatafyCMS API\n\n  update(value: T): Promise\u003cT\u003e                // Update the record with the value parameter\n\n  delete(): Promise\u003cvoid\u003e                     // Delete the record\n\n  publish(): Promise\u003cT\u003e                       // Publish the record\n\n  draft(): Promise\u003cT\u003e                         // UnPublish the record\n\n}\n```\n\n\n## Usage\nThis section provides example on how to use this library\n\nExample of selecting only some fields, applying 2 filters and searching by a value\nIn this example we have the Post resource, and we query the DatafyCMS API to retrieve only\nthe fields `title` and `created_at` by filtering the `created_at` to be greater than `2020-10-20`\nand `views` to be less than equal `120. We also search with a value.\n\nTo make the actual call we need to call `list` method\n\n```typescript\nimport datafyCMS from '@datafycms/js-client';\nimport { Operator } from \"@datafycms/js-client/types\";\n\nclass Post {\n  title: string;\n  created_at: string;\n  views: number;\n  content: string\n}\n\nconst response = await datafyCMS.collections\u003cPost\u003e('posts')\n  .fields(['title', 'created_at'])\n  .page(2)  // specify the page number, by default is 1\n  .pageSize(8) // specify the page size, by default is 20\n  .filterBy('created_at', Operator.GT, '2020-10-20')\n  .filterBy('views', Operator.LTE, 120)\n  .search('search in the content post')\n  .list()\n```\n\n\nTo get only one post\n\n```typescript\nconst article = await datafyCMS.collections\u003cPost\u003e('posts')\n  .fields(['title', 'created_at', 'content', 'slug', 'meta_title'])\n  .record('this-is-my-slug-value or some record ID')\n  .get()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinnify%2Fdatafycms-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinnify%2Fdatafycms-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinnify%2Fdatafycms-js/lists"}