{"id":17347946,"url":"https://github.com/floriansw/cftools-sdk","last_synced_at":"2025-07-12T22:36:14.558Z","repository":{"id":41869378,"uuid":"369893158","full_name":"FlorianSW/cftools-sdk","owner":"FlorianSW","description":"An easy to use JavaScript implementation to talk with the CFTools Cloud API from your JavaScript project.","archived":false,"fork":false,"pushed_at":"2024-11-13T19:36:02.000Z","size":1455,"stargazers_count":7,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T21:02:22.664Z","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/FlorianSW.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-22T19:45:08.000Z","updated_at":"2024-11-13T19:35:23.000Z","dependencies_parsed_at":"2023-01-29T04:01:04.160Z","dependency_job_id":"ce2c38f9-adee-4991-9302-d56085e46868","html_url":"https://github.com/FlorianSW/cftools-sdk","commit_stats":{"total_commits":97,"total_committers":3,"mean_commits":"32.333333333333336","dds":0.07216494845360821,"last_synced_commit":"1676df738c8db94b017962d62f1fa50e3e8b5a7a"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlorianSW%2Fcftools-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlorianSW%2Fcftools-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlorianSW%2Fcftools-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlorianSW%2Fcftools-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FlorianSW","download_url":"https://codeload.github.com/FlorianSW/cftools-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248961196,"owners_count":21189991,"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-10-15T16:50:38.394Z","updated_at":"2025-04-14T21:02:45.183Z","avatar_url":"https://github.com/FlorianSW.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cftools-sdk\n\n[![npm](https://img.shields.io/npm/v/cftools-sdk?style=flat-square)](https://www.npmjs.com/package/cftools-sdk)\n[![Discord](https://img.shields.io/discord/729467994832371813?color=7289da\u0026label=Discord\u0026logo=discord\u0026logoColor=ffffff\u0026style=flat-square)](https://go2tech.de/discord)\n\nThis library provides convenient methods to work with the [CFTools Cloud](https://www.cftools.cloud) API from a nodejs/JavaScript project.\n\n## Installation\n\nInstall via npm:\n\n```sh\nnpm install cftools-sdk\n```\n\n## Usage\n\nThe main piece you will work with is the `CFToolsClient`.\nIt provides methods to interact with the API actions of CFTools Cloud and are documented in the corresponding interface.\n\nCreate a new instance of the client with the builder as shown in this example:\n\n```typescript\nimport {CFToolsClientBuilder, SteamId64} from 'cftools-sdk';\n\nconst client = new CFToolsClientBuilder()\n    .withServerApiId('your-server-api-id')\n    .withCredentials('your-application-id', 'your-secret')\n    .build();\n\nclient.getPriorityQueue(SteamId64.of('a-steam-id')).then((item: PriorityQueueItem) =\u003e {\n    // Do something\n});\n```\n\n### API Reference\n\nYou can find the API reference for the SDK in [the documentation page](https://floriansw.github.io/cftools-sdk/).\n\n### Caching\n\nWhen using the SDK for a component that acts directly upon user interactions, consider that the CFTools Cloud API utilises a rate limit to protect for unusual load and abusive behaviour.\nThis SDK provides a way to circumvent a user issuing more requests to your program then the CFTools Cloud API allows you to do against a specific endpoint.\nEnabling caching for the CFToolsClient will cache successful responses from the CFTools Cloud API with a provided Cache and will hold this information up to the configured expiration time.\nThe SDK ships with one Cache, which holds responses in-memory.\n\nYou can enable caching with the builder:\n\n```typescript\nimport {CFToolsClientBuilder, SteamId64} from 'cftools-sdk';\n\nconst client = new CFToolsClientBuilder()\n    .withCache()\n    .withServerApiId('your-server-api-id')\n    .withCredentials('your-application-id', 'your-secret')\n    .build();\n\nclient.getPriorityQueue(SteamId64.of('a-steam-id')).then((item: PriorityQueueItem) =\u003e {\n    // Do something\n});\n```\n\nNote, that mutable operations (like adding a priority queue entry) will never be cached.\n\n### Enterprise API\n\nBy default, the cftools-sdk uses the general purpose [Data API](https://developer.cftools.cloud/documentation/data-api).\nIn addition to that, the enterprise API is supported as well, which is a special-built API with some restrictions of the Data API lifted.\n\nYou can setup the SDK to use the Enterprise API with the builder:\n\n```typescript\nimport {CFToolsClientBuilder, SteamId64} from 'cftools-sdk';\n\nconst client = new CFToolsClientBuilder()\n    .withServerApiId('your-server-api-id')\n    .withCredentials('your-application-id', 'your-secret')\n    .withEnterpriseApi('your-enterprise-api-key')\n    .build();\n\nclient.getPriorityQueue(SteamId64.of('a-steam-id')).then((item: PriorityQueueItem) =\u003e {\n    // Do something\n});\n```\n\n## Contribution\n\nThis library is not complete yet and needs your help: What methods and features are missing?\nHow can the documentation be improved?\nSimply create an issue in the Github repository with as much details as possible.\n\nPull requests are welcome as well :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloriansw%2Fcftools-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffloriansw%2Fcftools-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloriansw%2Fcftools-sdk/lists"}