{"id":18663552,"url":"https://github.com/sanjacob/tiny-api-client-ts","last_synced_at":"2025-11-06T08:30:26.935Z","repository":{"id":224567874,"uuid":"763603561","full_name":"sanjacob/tiny-api-client-ts","owner":"sanjacob","description":"The short and sweet way to create API clients in JavaScript and TypeScript","archived":false,"fork":false,"pushed_at":"2024-02-29T13:15:46.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-12T20:26:11.005Z","etag":null,"topics":["api-client","decorators","fetch"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/tiny-api-client","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sanjacob.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"sanjacob"}},"created_at":"2024-02-26T15:49:52.000Z","updated_at":"2024-02-29T10:42:01.000Z","dependencies_parsed_at":"2024-02-29T12:32:23.036Z","dependency_job_id":null,"html_url":"https://github.com/sanjacob/tiny-api-client-ts","commit_stats":null,"previous_names":["sanjacob/tiny-api-client-ts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanjacob%2Ftiny-api-client-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanjacob%2Ftiny-api-client-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanjacob%2Ftiny-api-client-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanjacob%2Ftiny-api-client-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sanjacob","download_url":"https://codeload.github.com/sanjacob/tiny-api-client-ts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239487737,"owners_count":19647055,"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","decorators","fetch"],"created_at":"2024-11-07T08:18:41.202Z","updated_at":"2025-11-06T08:30:26.900Z","avatar_url":"https://github.com/sanjacob.png","language":"TypeScript","readme":"# Tiny API Client for TypeScript 🐝\n\n[![NPM Registry][version-shield]][npm] [![License: GPL  v2][license-shield]][gnu]\n\n\u003e [!WARNING]\n\u003e This package is in early development,\n\u003e and its API is still changing quite often.\n\u003e Use in production at your own risk.\n\u003e On the other hand, contributions are more than welcome.\n\n\nThe short and sweet way to write API consumers\n\n```typescript\nimport { APIClient, get, post, del } from 'tiny-api-client';\n\n@APIClient(({v}) =\u003e `https://example.org/api/public/v${v}`)\nclass MyAPIClient {\n  @get(({userId}) =\u003e `/users/${userId}`)\n  findUser(params: {userId: string}, options: any = {}, response?: User) {\n    return response;\n  }\n\n  @post(() =\u003e '/notes')\n  createNote(params: {}, options: any, response?: Note) {\n    return response;\n  }\n\n  @del(({noteId, fileId}) =\u003e `/notes/${noteId}/files/${fileId}`)\n  deleteNoteFile(params: {noteId: string, fileId: string}, options: any, response?: boolean) {\n    return response;\n  }\n}\n\n\u003e\u003e const client = new MyClient()\n\u003e\u003e client.findUser({userId: 'PeterParker'})\n{'name': 'Peter', 'surname': 'Parker', ...}\n\u003e\u003e client.createNote({}, {body: {title: 'New Note', content: 'Hello World!'}})\n{'id': ...}\n```\n\n\n## About\n\nThis package is my TypeScript adaptation of the tiny-api-client library I\noriginally wrote for Python. Its purpose is to provide an easy way for API\nconsumers, such as Vue or React frontends, to call operations on the API.\nNote that there are significant differences between the Python and TS\ninterfaces. Furthermore, some of the features that exist in the Python\nlibrary do not exist in this one yet. Some features may present bugs.\n\n### Requirements\n\nIf you are using Node.js:\n\n- Node.js \u003e=18.x (requires Fetch API)\n\n\n\n## Features\n\n- Endpoints can be declared with one of: `@get`, `@post`, `@put`, `@patch`, `@del`\n- Auto-conversion of responses to *JSON*, can be disabled per endpoint\n- Route parameters are optional\n- Set the `.apiToken` property to send a bearer token\n- Easy integration with your custom API models\n- Full control over route parameter templates\n- Support for API version insertion in url template\n- Freedom over parameter types and defaults in each endpoint\n- Wraps the native `fetch` api, and options are passed to it\n\n\n\n## Installation\n\n```bash\nbun add tiny-api-client\n```\n\n\u003e Feel free to use npm, yarn, or other instead\n\n\n\n## Documentation\n\nThe documentation is still not available.\n\n\n## License\n\n[![License: LGPL  v2.1][license-shield]][gnu]\n\nThis software is distributed under the\n[Lesser General Public License v2.1][license],\nmore information available at the [Free Software Foundation][gnu].\n\n\n\n\u003c!-- LINKS --\u003e\n[npm]: https://www.npmjs.com/package/tiny-api-client\n\n\u003c!-- SHIELDS --\u003e\n[version-shield]: https://img.shields.io/npm/v/tiny-api-client?color=blue\n\n\u003c!-- LICENSE --\u003e\n\n[license]: LICENSE \"Lesser General Public License v2.1\"\n[gnu]: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html \"Free Software Foundation\"\n[license-shield]: https://img.shields.io/github/license/sanjacob/tiny-api-client-ts\n","funding_links":["https://github.com/sponsors/sanjacob"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanjacob%2Ftiny-api-client-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanjacob%2Ftiny-api-client-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanjacob%2Ftiny-api-client-ts/lists"}