{"id":19732360,"url":"https://github.com/terminusdb/terminusdb-client-js","last_synced_at":"2026-02-25T14:09:50.986Z","repository":{"id":39634096,"uuid":"204949228","full_name":"terminusdb/terminusdb-client-js","owner":"terminusdb","description":"TerminusDB JavaScript Client","archived":false,"fork":false,"pushed_at":"2024-11-19T13:04:07.000Z","size":9730,"stargazers_count":39,"open_issues_count":12,"forks_count":13,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-23T06:35:03.175Z","etag":null,"topics":["api-client","javascript","owl-schema","terminus-client","terminusdb"],"latest_commit_sha":null,"homepage":"https://terminusdb.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terminusdb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"Contributing.md","funding":null,"license":"LICENSE","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":"2019-08-28T14:18:22.000Z","updated_at":"2025-02-15T06:20:55.000Z","dependencies_parsed_at":"2024-08-12T09:11:41.231Z","dependency_job_id":"9a6cbd01-d498-4ff7-82c6-3cb20054624d","html_url":"https://github.com/terminusdb/terminusdb-client-js","commit_stats":{"total_commits":1285,"total_committers":32,"mean_commits":40.15625,"dds":0.7595330739299611,"last_synced_commit":"7efe5ebdb854410c52ee37da179556794980d4ae"},"previous_names":["terminusdb/woql-client","terminusdb/terminus-client"],"tags_count":59,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terminusdb%2Fterminusdb-client-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terminusdb%2Fterminusdb-client-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terminusdb%2Fterminusdb-client-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terminusdb%2Fterminusdb-client-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terminusdb","download_url":"https://codeload.github.com/terminusdb/terminusdb-client-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246916734,"owners_count":20854511,"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-client","javascript","owl-schema","terminus-client","terminusdb"],"created_at":"2024-11-12T00:25:59.953Z","updated_at":"2026-02-25T14:09:50.980Z","avatar_url":"https://github.com/terminusdb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![TerminusDB JavaScript Client](https://assets.terminusdb.com/readmes/terminusdb-client-js/header.gif)][terminusdb-client-js-docs]\n\n[terminusdb-client-js-docs]: https://terminusdb.github.io/terminusdb-client-js/\n\n---\n\n[![Discord](https://img.shields.io/discord/689805612053168129?label=Discord\u0026logo=Discord\u0026style=plastic)](https://discord.gg/yTJKAma)\n[![Reddit](https://img.shields.io/reddit/subreddit-subscribers/TerminusDB?style=social)](https://www.reddit.com/r/TerminusDB/)\n[![Twitter](https://img.shields.io/twitter/follow/terminusdb?color=skyblue\u0026label=Follow%20on%20Twitter\u0026logo=twitter\u0026style=flat)](https://twitter.com/TerminusDB)\n\n[![npm version](https://img.shields.io/npm/v/terminusdb?logo=npm)](https://www.npmjs.com/package/terminusdb)\n[![npm downloads](https://img.shields.io/npm/dw/terminusdb?color=red\u0026label=npm%20package\u0026logo=npm\u0026style=flat)](https://www.npmjs.com/package/terminusdb)\n[![Coverage Status](https://coveralls.io/builds/76119876/badge)](https://coveralls.io/builds/76119876)\n\n\u003e This repository is for the JavaScript client library for TerminusDB\n\n[**TerminusDB**][terminusdb] is an [open-source][terminusdb-repo] graph database and document store. It allows you to link and process structured and unstructured JSON documents in a powerful knowledge graph all through a simple document API.\n\n[terminusdb]: https://terminusdb.org/\n[terminusdb-docs]: https://terminusdb.org/docs/\n[terminusdb-repo]: https://github.com/terminusdb/terminusdb\n\nIt is the model-based, in-memory, and distributed knowledge graph database for hierarchical records with a git-for-data collaboration model at its heart. So many great things in a single package and a high precision datalog query language with advanced features like transactions, schema validation and unification.\n\nFor many, it serves as a headless content management system for complex enviroments with push, pull, clone, rebase and merge capabilities with immutable history and a strong schema checker that covers both the simplest and most advanced models.\n\nUse the [cloud-based studio environment](https://studio.dfrnt.com/) to [build graph data products in the cloud](https://dfrnt.com/solutions-studio) or in your [localhost dockerized TerminusDB instances](https://terminusdb.org/docs/install-terminusdb-as-a-docker-container/). Try it out for yourself, it's free to get started with generous limits, clone a demo project to play around.\n\n## Requirements\n\n- Node.js version 20+ if using the TerminusDB client library as a Node.js package (might work with earlier versions too).\n\n## Installation\n\nThe TerminusDB JavaScript client library can be used either as a Node.js package or as a script that runs in the browser.\n\n### NPM Package\n\n\u003e :memo: If you don't already have Node.js installed, [install it][node-install] first.\n\n[node-install]: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm\n\nTo install the `terminusdb` package as a dependency in an existing package, run:\n\n```sh\n$ npm install --save terminusdb\n```\n\nThis command updates your `package.json`.\n\n### Script\n\nTo use the `terminusdb-client` script on a webpage sourced from a CDN, add this to your HTML:\n\n```html\n\u003cscript src=\"https://unpkg.com/terminusdb/dist/terminusdb-client.min.js\"\u003e\u003c/script\u003e\n```\n\nAlternatively, you can download the latest [`terminusdb-client.min.js`][js], add it to your sources, and use that in the `\u003cscript\u003e` instead.\n\n[js]: https://unpkg.com/terminusdb/dist/terminusdb-client.min.js\n\n## Usage\n\nThis example creates a simple dataProduct, starting to create a database model the schema\nand insert a simple document\n\nFor the [full Documentation](https://terminusdb.org/docs/javascript)\n\n```javascript\nconst TerminusClient = require(\"terminusdb\");\n\n// Connect and configure the TerminusClient\nconst client = new TerminusClient.WOQLClient('SERVER_CLOUD_URL/mycloudTeam',\n                       {user:\"myemail@something.com\", organization:'mycloudTeam'})\n                                            \nclient.setApiKey(MY_ACCESS_TOKEN)\n\nconst bankerSchema = [\n   {\n      \"@type\":\"Class\",\n      \"@id\":\"BankAccount\",\n      \"@key\":{\n         \"@type\":\"Hash\",\n         \"@fields\":[\n            \"account_id\"\n         ]\n      },\n      \"account_id\":\"xsd:string\",\n      \"owner\":\"Person\",\n      \"balance\":\"xsd:decimal\"\n   },\n   {\n      \"@type\":\"Class\",\n      \"@id\":\"Person\",\n      \"@key\":{\n         \"@type\":\"Lexical\",\n         \"@fields\":[\n            \"name\"\n         ]\n      },\n      \"name\":\"xsd:string\"\n   }\n]\n \nasync function createDataProduct(){\n    try{\n\n        await client.createDatabase(\"banker\", {label: \"Banker Account\", \n                                              comment: \"Testing\", schema: true})\n        //add the schema documents\n        await client.addDocument(bankerSchema,{\"graph_type\":\"schema\"},null,\"add new schema\") \n    \n        const accountObj = {\"@type\":\"BankAccount\",\n                            \"account_id\":\"DBZDFGET23456\",\n                            \"owner\":{\n                                \"@type\":\"Person\",\n                                \"name\":\"Tom\"\n                            },\n                            \"balance\":1000\n                          }\n\n        //add a document instance\n        await client.addDocument(accountObj)\n\n        client.getDocument({\"as_list\":true,id:'Person/Tom'})\n\n    }catch(err){\n        console.error(err.message)\n    }\n  }\n\n```\n\n## Options\n\nConnections options.\n\nTo initialize `TerminusDB client` with custom options use\n\n```js\nconst TerminusClient = require(\"terminusdb\");\n\nconst client = new TerminusClient.WOQLClient(\"http://127.0.0.1:6363/\", {\n  db: \"test_db\",\n  user: \"admin\",\n  key: \"my_secret_key\",\n});\n```\n\n## API\n\nThe TerminusDB API can be found at the [TerminusDB Documentation][terminusdb-docs].\n\nTerminusDB communicates using JSON over HTTP. It works with advanced datatypes including integers, floats, decimals, big integers, arbitrary precision decimals, dates and other important XML Datatypes. Math is capped at 20 digits of precision, where the core is ready to support higher precision if needed.\n\n## Report Issues\n\nIf you encounter any issues, please report it with your os and environment setup, the version that you are using, and a simple reproducible case.\n\nIf you encounter other questions, you can ask them on our [Discord Server](https://discord.gg/hTU3XWSzuZ).\n\n## Contribute\n\n\u003e :memo: This project uses [Husky](https://www.npmjs.com/package/husky) which automatically runs lint, tests, and other scripts when you try to commit any changes to the repository. This helps us to improve each commit done to the repo and is automatically installed and configured when you do `npm install`\n\nIt will be nice, if you open an issue first so that we can know what is going on, then, fork this repo and push in your ideas. Do not forget to add a bit of test(s) of what value you adding.\n\nPlease check [Contributing.md](Contributing.md) for more information.\n\n## Licence\n\nThe APACHE 2.0 License\n\nCopyright (c) 2019\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterminusdb%2Fterminusdb-client-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterminusdb%2Fterminusdb-client-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterminusdb%2Fterminusdb-client-js/lists"}