{"id":21045146,"url":"https://github.com/fullpipe/js-json-rpc-client","last_synced_at":"2025-07-01T22:34:55.609Z","repository":{"id":41782796,"uuid":"235174994","full_name":"fullpipe/js-json-rpc-client","owner":"fullpipe","description":null,"archived":false,"fork":false,"pushed_at":"2022-04-28T22:17:42.000Z","size":58,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-15T03:09:14.057Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fullpipe.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":"2020-01-20T18:55:46.000Z","updated_at":"2020-12-27T18:05:06.000Z","dependencies_parsed_at":"2022-08-11T17:01:12.261Z","dependency_job_id":null,"html_url":"https://github.com/fullpipe/js-json-rpc-client","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/fullpipe/js-json-rpc-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fullpipe%2Fjs-json-rpc-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fullpipe%2Fjs-json-rpc-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fullpipe%2Fjs-json-rpc-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fullpipe%2Fjs-json-rpc-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fullpipe","download_url":"https://codeload.github.com/fullpipe/js-json-rpc-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fullpipe%2Fjs-json-rpc-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260966082,"owners_count":23090061,"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-11-19T14:20:11.404Z","updated_at":"2025-07-01T22:34:55.540Z","avatar_url":"https://github.com/fullpipe.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# js-json-rpc-client\n\nJson rpc client\n\n\n## Installation \n```sh\nnpm install js-json-rpc-client --save\n```\n\n## Usage\n\n### TypeScript\n\n```typescript\nimport { Injectable } from \"@angular/core\";\nimport { RpcClient } from \"js-json-rpc-client\";\nimport { FetchTransport } from \"js-json-rpc-client\";\n\n@Injectable({\n  providedIn: \"root\"\n})\nexport class RpcService {\n  private token: string;\n  private client: RpcClient;\n\n  constructor() {\n    this.client = new RpcClient(\n      new FetchTransport({\n        url: \"http://127.0.0.1:8000/api\",\n        retryConfig: {\n          maxRetryAttempts: 10,\n          scalingDuration: 500\n        }\n      })\n    );\n\n    this.client.before(request =\u003e {\n      if (this.token) {\n        request.headers[\"Authorization\"] = \"Bearer \" + this.token;\n      }\n    });\n  }\n\n  call(method: string, params?: { [key: string]: any }) {\n    return this.client.call(method, params);\n  }\n\n  setToken(token: string) {\n    this.token = token;\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffullpipe%2Fjs-json-rpc-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffullpipe%2Fjs-json-rpc-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffullpipe%2Fjs-json-rpc-client/lists"}