{"id":17551372,"url":"https://github.com/robingenz/engine4-node","last_synced_at":"2026-05-15T22:05:29.092Z","repository":{"id":64031342,"uuid":"571264447","full_name":"robingenz/engine4-node","owner":"robingenz","description":"⚙️ Node.js library for the ENGINE4 API.","archived":false,"fork":false,"pushed_at":"2023-09-05T15:15:10.000Z","size":449,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-12T17:14:03.503Z","etag":null,"topics":["api","engine4","node","node-sdk"],"latest_commit_sha":null,"homepage":"https://docs.engine4.io/api","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robingenz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-11-27T17:24:48.000Z","updated_at":"2022-11-30T12:31:08.000Z","dependencies_parsed_at":"2023-02-01T07:30:41.633Z","dependency_job_id":null,"html_url":"https://github.com/robingenz/engine4-node","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/robingenz/engine4-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robingenz%2Fengine4-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robingenz%2Fengine4-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robingenz%2Fengine4-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robingenz%2Fengine4-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robingenz","download_url":"https://codeload.github.com/robingenz/engine4-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robingenz%2Fengine4-node/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259606868,"owners_count":22883555,"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":["api","engine4","node","node-sdk"],"created_at":"2024-10-21T04:45:41.121Z","updated_at":"2025-10-12T17:48:40.220Z","avatar_url":"https://github.com/robingenz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# engine4-node\n\n[![Build](https://img.shields.io/github/actions/workflow/status/robingenz/engine4-node/ci.yml?branch=main)](https://github.com/robingenz/engine4-node/actions?query=workflow%3A%22CI%22)\n[![License](https://img.shields.io/npm/l/engine4-node)](https://github.com/robingenz/engine4-node/blob/main/LICENSE)\n[![npm (version)](https://img.shields.io/npm/v/engine4-node)](https://www.npmjs.com/package/engine4-node)\n[![npm (downloads)](https://img.shields.io/npm/dm/engine4-node)](https://www.npmjs.com/package/engine4-node)\n\n⚙️ Node.js library for the ENGINE4 API.\n\n## Installation\n\nUse [npm](https://docs.npmjs.com/cli/) to install the package:\n\n```bash\nnpm install engine4-node\n```\n\n## Usage\n\nFirst of all, you import `ENGINE4` so that you can create an instance of the class.\nYou need to pass the `baseUrl` of the API server:\n\n```typescript\nimport { ENGINE4 } from 'engine4-node';\n\nconst engine4 = new ENGINE4({ baseUrl: 'https://test.engine4.io' });\n```\n\nNow you can authenticate yourself with `username`, `password` and `clientId`:\n\n```typescript\nconst authenticate = async () =\u003e {\n  const { accessToken } = await engine4.authenticate({\n    username: 'my_username',\n    password: 'my_password',\n    clientId: 'my_client_id',\n  });\n  return accessToken;\n};\n```\n\nThe access token is required for the following calls.\n\nHere you can find examples for deleting, querying, inserting and updating records:\n\n```typescript\nimport { ENGINE4, CompareOperator } from 'engine4-node';\n\nconst accessToken = await authenticate();\n\nconst delete = async () =\u003e {\n  await engine4.delete({\n    accessToken,\n    entityId: '39aeedee-91e3-4ec4-b7bb-b5a036601f9f',\n    dataId: '3c7d04f7-74e6-4cfd-9fd6-233c6f4ded8a',\n  });\n};\n\nconst deleteMultiple = async () =\u003e {\n  await engine4.deleteMultiple({\n    accessToken,\n    entityId: '39aeedee-91e3-4ec4-b7bb-b5a036601f9f',\n    dataIds: [\n      '3c7d04f7-74e6-4cfd-9fd6-233c6f4ded8a',\n      '7130fa8b-4040-40d0-b97b-a9006fc140ec',\n    ],\n  });\n};\n\nconst fetch = async () =\u003e {\n  const { items } = await engine4.fetch({\n    accessToken,\n    entityId: '7130fa8b-4040-40d0-b97b-a9006fc140ec',\n    take: 10,\n    skip: 20,\n    filter: {\n      genericName: 'Custom_001',\n      compareOperator: CompareOperator.Equal,\n      value: 'my_value',\n    },\n    sorting: [\n      {\n        genericName: 'Custom_001',\n        sort: 'desc',\n      },\n    ],\n  });\n  return items;\n};\n\nconst get = async () =\u003e {\n  const { item } = await engine4.get({\n    accessToken,\n    entityId: '39aeedee-91e3-4ec4-b7bb-b5a036601f9f',\n    dataId: '3c7d04f7-74e6-4cfd-9fd6-233c6f4ded8a',\n  });\n  return item;\n};\n\nconst getMultiple = async () =\u003e {\n  const { items } = await engine4.getMultiple({\n    accessToken,\n    entityId: '39aeedee-91e3-4ec4-b7bb-b5a036601f9f',\n    dataIds: [\n      '3c7d04f7-74e6-4cfd-9fd6-233c6f4ded8a',\n      '7130fa8b-4040-40d0-b97b-a9006fc140ec',\n    ],\n  });\n  return items;\n};\n\nconst saveAll = async () =\u003e {\n  const { items } = await engine4.saveAll({\n    accessToken,\n    items: [\n      {\n        EntityId: '39aeedee-91e3-4ec4-b7bb-b5a036601f9f',\n        DataId: '3c7d04f7-74e6-4cfd-9fd6-233c6f4ded8a',\n        Custom_001: 'my_value',\n      }\n    ],\n    returnType: 'dataId',\n  });\n  return items;\n};\n\nconst fetchAttachment = async () =\u003e {\n  const { item } = await engine4.fetchAttachment({\n    accessToken,\n    dataId: \"ea10248d-1fe8-4baf-84d7-d18a64106b40\",\n  });\n  return item;\n};\n\nconst fetchAndSaveAttachment = async () =\u003e {\n  const { writeFile } = require(\"fs\");\n  const { promisify } = require(\"util\");\n  const writeFilePromise = promisify(writeFile);\n\n  const { item } = await engine4.fetchAttachment({\n    accessToken,\n    dataId: \"ea10248d-1fe8-4baf-84d7-d18a64106b40\",\n  });\n  await writeFilePromise(\"test.pdf\", item);\n};\n```\n\n## Changelog\n\nSee [CHANGELOG.md](https://github.com/robingenz/engine4-node/blob/main/CHANGELOG.md).\n\n## License\n\nSee [LICENSE](https://github.com/robingenz/engine4-node/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobingenz%2Fengine4-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobingenz%2Fengine4-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobingenz%2Fengine4-node/lists"}