{"id":13523339,"url":"https://github.com/dfinity/agent-js","last_synced_at":"2025-05-14T19:04:55.643Z","repository":{"id":37081101,"uuid":"290373310","full_name":"dfinity/agent-js","owner":"dfinity","description":"A collection of libraries and tools for building software around the Internet Computer, in JavaScript.","archived":false,"fork":false,"pushed_at":"2025-04-01T06:35:54.000Z","size":15938,"stargazers_count":162,"open_issues_count":68,"forks_count":98,"subscribers_count":33,"default_branch":"main","last_synced_at":"2025-04-03T02:48:51.684Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://agent-js.icp.xyz","language":"TypeScript","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/dfinity.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-26T02:21:00.000Z","updated_at":"2025-04-01T22:21:07.000Z","dependencies_parsed_at":"2023-02-16T04:45:34.019Z","dependency_job_id":"2d70be76-ce2f-45c9-abf3-a8f57f03083f","html_url":"https://github.com/dfinity/agent-js","commit_stats":{"total_commits":522,"total_committers":64,"mean_commits":8.15625,"dds":0.5134099616858238,"last_synced_commit":"12b851f01fb0a0fc911089f37282adcb59e991bb"},"previous_names":[],"tags_count":78,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinity%2Fagent-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinity%2Fagent-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinity%2Fagent-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinity%2Fagent-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfinity","download_url":"https://codeload.github.com/dfinity/agent-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161262,"owners_count":21057552,"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":[],"created_at":"2024-08-01T06:00:59.074Z","updated_at":"2025-04-10T04:52:23.680Z","avatar_url":"https://github.com/dfinity.png","language":"TypeScript","readme":"# agent-js\n\nUse an Agent to interact with the Internet Computer from your JavaScript program.\n\nThis source code repository contains multiple npm packages, each under `./packages/`.\n\n## Development\n\n### Getting Started\n\n1. Clone the git repository.\n2. Run `npm i -g npm`\n3. Run `npm install`\n\nAfter that, you probably want to dive into a specific package in [./packages](./packages).\n\n### Running Tests\n\nRunning tests is a good way to get a sense of what the features will do. We try to have full unit test coverage for all new features, although sometimes mocking network conditions can be difficult, and e2e tests may be preferable.\n\nBefore running tests, you need to compile the packages.\n\n```bash\nnpm run build\n```\n\nThis command will compile the packages and generate the output under `lib` directory in each package.\n\n#### Unit Tests\n\nTo run the unit tests for all packages, run `npm test`. You can run tests for a specific package by running `npm test` in the package directory or by running `npm test --workspace=\u003cpackage-name\u003e` in the root directory.\n\n#### E2E Tests\n\nThere are two sets of e2e tests in this repository. They are located in `e2e/browser` and `e2e/node`. The browser tests are run in a headless browser, and the node tests are run in a node environment. The node tests are faster and require less setup, but the browser tests can simulate relevant environmental conditions.\n\n\u003e **Important Note:** the e2e tests do not run from the TypeScript source code of projects and must be compiled. You should run `npm run build` to compile the projects after your changes before running the tests.\n\nTo run the e2e node tests, you can run \n  \n```bash\ndfx start --background --clean\nnpm run e2e --workspace e2e/node\ndfx stop\n```\n\nWe expect you to have the replica running on port `4943`. If you are using a different port, you can set an environment variable `REPLICA_PORT` to the port number.\n\n\u003e Note: browser tests have been temporarily removed pending a rewrite\n\nTo run the e2e browser tests, you can run\n\n```bash\ndfx start --background --clean\nnpm run setup --workspace e2e/browser\nnpm run e2e --workspace e2e/browser\ndfx stop\n```\n\n#### Workspaces\n\nWe use `npm` to manage this repo and its packages. A few useful\ncommands to keep in mind;\n\n- To run the unit tests locally, you can use `npm run test`.\n- To run e2e tests, you can use `npm run e2e`. **WARNING:** You need to have a running\n  replica locally. In our CI runs, we use the `ic-ref` which is not (at this time) available\n  publicly. Normally you can use a replica distributed with dfx (ie. dfx start in a project),\n  but there is no guarantee that the `next` branch will work with the latest published dfx.\n  Once you have a replica running locally, you must pass the port to the e2e tests using the\n  `REPLICA_PORT` environment vairable. If that variable is not set, the tests will fail.\n\n### bin/\\* scripts\n\nThe following scripts can be found in [./bin](./bin):\n\n- update-management-idl - Update the management canister IDL in @dfinity/agent\n\nMonorepo-related scripts run in this order, but are usually invoked by `npm install`:\n\n- npm-postinstall - Run with `npm run postinstall` in this monorepo package.\n  - It copies devtools dependencies from ./packages/agent-js-devtools/node_modules -\u003e ./node_modules\n- build - Build (`npm run build`) each subpackage in ./packages/\n- test - Run `npm test` in each subpackage\n\n## Contributing\n\nContributions are welcome! Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md), where you can find more details about:\n\n- Setting up the repository, making changes, documenting these changes, adherence to automated formatting like prettier, and Continuous Integration, which is facilitated by GitHub Actions.\n- Information about our review process.\n- The release process, publishing to NPM, and publishing docs.\n- The process for deprecating packages in this repository.\n\n## License\n\nThis project is licensed under the [Apache-2.0 License](LICENSE).\n","funding_links":[],"categories":["Client Libraries (Agents)","TypeScript"],"sub_categories":["JavaScript/TypeScript"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfinity%2Fagent-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfinity%2Fagent-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfinity%2Fagent-js/lists"}