{"id":15394081,"url":"https://github.com/keneucker/biketag-api","last_synced_at":"2025-04-15T23:52:52.320Z","repository":{"id":41974411,"uuid":"353755573","full_name":"KenEucker/biketag-api","owner":"KenEucker","description":"The javascript client for interacting with BikeTag games.","archived":false,"fork":false,"pushed_at":"2025-03-07T00:45:00.000Z","size":19222,"stargazers_count":10,"open_issues_count":15,"forks_count":6,"subscribers_count":2,"default_branch":"production","last_synced_at":"2025-04-11T00:01:55.923Z","etag":null,"topics":["api","game","gunjs","isomorphic-javascript","reddit","sanity-io","twitter","typescript","typescript-library"],"latest_commit_sha":null,"homepage":"https://keneucker.github.io/biketag-api/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KenEucker.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"contributing.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"code_of_conduct.md","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},"funding":{"github":["KenEucker","evan-white"],"patreon":"BikeTag","custom":"https://www.paypal.com/paypalme/keneucker"}},"created_at":"2021-04-01T16:07:01.000Z","updated_at":"2025-03-07T00:40:31.000Z","dependencies_parsed_at":"2023-02-10T21:31:02.151Z","dependency_job_id":"65dde94f-f3ca-4aa8-8be3-1fea7bc5d122","html_url":"https://github.com/KenEucker/biketag-api","commit_stats":null,"previous_names":[],"tags_count":115,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KenEucker%2Fbiketag-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KenEucker%2Fbiketag-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KenEucker%2Fbiketag-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KenEucker%2Fbiketag-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KenEucker","download_url":"https://codeload.github.com/KenEucker/biketag-api/tar.gz/refs/heads/production","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249173061,"owners_count":21224481,"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","game","gunjs","isomorphic-javascript","reddit","sanity-io","twitter","typescript","typescript-library"],"created_at":"2024-10-01T15:21:47.890Z","updated_at":"2025-04-15T23:52:52.303Z","avatar_url":"https://github.com/KenEucker.png","language":"TypeScript","funding_links":["https://github.com/sponsors/KenEucker","https://github.com/sponsors/evan-white","https://patreon.com/BikeTag","https://www.paypal.com/paypalme/keneucker"],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\" style=\"border-bottom: none;\"\u003ebiketag\u003c/h1\u003e\n\u003ch3 align=\"center\"\u003eBikeTag Official JavaScript library\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/biketag/v/latest\"\u003e\n    \u003cimg alt=\"npm next version\" src=\"https://img.shields.io/npm/v/biketag/latest.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/keneucker/biketag-api/actions?query=workflow%3ATests+branch%3Anext\"\u003e\n    \u003cimg alt=\"Build states\" src=\"https://github.com/keneucker/biketag-api/workflows/Tests/badge.svg\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://creativecommons.org/licenses/by-sa/4.0/\"\u003e\n    \u003cimg src='https://img.shields.io/github/license/KenEucker/biketag-api' alt='license'\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://github.com/sponsors/KenEucker\"\u003e\n    \u003cimg alt=\"Sponsors\" src=\"https://img.shields.io/github/sponsors/keneucker\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://gitter.im/biketagorg/community\"\u003e\n    \u003cimg alt=\"Sponsors\" src=\"https://badges.gitter.im/gitterHQ/gitter.png\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/keneucker/biketag-api/discussions\"\u003e\n    \u003cimg alt=\"Join the community on GitHub Discussions\" src=\"https://img.shields.io/badge/Join%20the%20community-on%20GitHub%20Discussions-blue\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg alt=\"biketag-api logo\" src=\"https://raw.githubusercontent.com/keneucker/biketag-website/production/public/img/biketag-api-logo.jpg\" height=\"auto\" width=\"200\" style=\"border-radius:25%;\"\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n## Installation\n_This package is Isomorphic and Typescript ready_\n\n`npm install biketag`\n\n\u003c/div\u003e\n\n## How to include it in your projects\n\nThe library is a default export, as well as a named class export `BikeTagClient`. You can retrieve it from jsDeliver or npm, and it works in both the browser and nodejs.\n\n### Browser\n\nUsing jsDelivr CDN:\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/biketag/client.js\"\u003e\u003c/script\u003e\n```\n\nUsing unpkg CDN:\n\n```html\n\u003cscript src=\"https://unpkg.com/npm/client.js\"\u003e\u003c/script\u003e\n```\n\n### CommonJS\n\nimport/require the module:\n```ts\n// Using import statement\nimport { BikeTagClient } from 'biketag'\n```\n\n```js\n// Using require()\nconst { BikeTagClient } = require('biketag')\n```\n\n---\n\n## Usage\n\n### Instantiate with or without credentials (browser):\n```js\n// if you have your clientKey/clientToken to retrieve an access token automatically, you can pass those in:\nconst client = new biketag({\n  game: 'portland',\n  clientKey: process.env.BIKETAG_CLIENT_KEY,\n  clientToken: process.env.BIKETAG_CLIENT_TOKEN,\n})\n```\n\n### Instantiate with or without credentials (node):\n```ts\n// if you have Imgur credentials: clientId and clientSecret\nconst client = new BikeTagClient({\n  game: 'portland',\n  imgur: {\n    clientId: process.env.IMGUR_CLIENT_ID,\n    clientSecret: process.env.IMGUR_CLIENT_SECRET,\n  }\n})\n```\n\u003cdiv align=\"center\"\u003e\n\n### Configuration\n\nThe BikeTag API requires only the game to be set in the configuration in order to read BikeTag data. You can read more about specific configurations in the documentation: \n\n\u003c/div\u003e\n\n### **⚠️ For brevity, the rest of the examples will leave out the import and/or instantiation step.**\n\n\n### Get Game Information\n\nYou can get game information by providing the name.\n\n```ts\n// retrieves the BikeTag game data 'portland' game\nconst biketagPortland = await client.game('portland')\n```\n\n### Get Tags\n\nYou can get tags one by one or all at once for a given game using the `getTag` and `getTags` methods. You can also explicitely set the data adapter to any of the configurable sources (biketag, imgur, sanity):\n\n```ts\n// retrieves the BikeTag game data 'portland' game\nconst biketagPortland = await client.game('portland')\n\n// retrieves the latest BikeTag posted for the 'portland' game from the most available API\nconst biketagPortlandCurrent = await client.getTag()\n\n// retrieves the BikeTag #1 for the 'portland' game from imgur adapter\nconst biketagPortland1 = await client.tags(1, { source: 'imgur' })\n\n// retrieves the all BikeTags for the 'portland' game from sanity adapter\nconst allPortlandTags = await client.tags(undefined, { source: 'sanity' })\n\n```\n\n### Get Players\n\nYou can get the players of a game by calling getPlayers\n\n```ts\n// retrieves the BikeTag player data 'portland' game\nconst biketagPortlandPlayers = await biketagAPI.getPlayers('portland')\n```\n\n\u003cdiv align=\"center\"\u003e\n\n## Credits\n\n\u003c/div\u003e\n\nThis project is heavily influenced by the [node-imgur][node-imgur] package, the Imgur API and it's documentation, and Sanity.IO's javascript client.\n\nUsing the typescript library configured and developed on the node-imgur v2 project: https://github.com/kaimallea/node-imgur, this package comes bundled with testing using jest and automated releases using github actions. Many thanks to Kaimallea for collaborating with me on the imgur API because I learned so much along the way!\n\nSupport the BikeTag Project on [GitHub][github], [Patreon][patreon], or directly by going out and playing a round of [BikeTag in your city](https://biketag.org)!\n\n[github]: https://github.com/sponsors/KenEucker\n[patreon]: https://patreon.com/BikeTag\n[node-imgur]: https://github.com/kaimallea/node-imgur\n[sanity]: https://www.sanity.io/docs/api-versioning\n[imgur]: https://www.npmjs.com/package/imgur/v/next\n\n![Alt](https://repobeats.axiom.co/api/embed/efea76b8d7f37062fcded362417a369dc9a3a401.svg \"Repobeats analytics image\")\n\n\u003cdiv align=\"center\"\u003e\n\n  ## Vendors\n\n  Images powered by imgur.com\n\n  [![imgur.com][imgur-image]](https://apidocs.imgur.com/)\n\n  Structured Content powered by sanity.io\n\n  [![sanity.io][sanity-image]](https://www.sanity.io/docs/http-api)\n\n  [biketag-logo]: https://raw.githubusercontent.com/keneucker/biketag-website/production/public/img/biketag-api-logo.jpg\n  [imgur-image]: https://raw.githubusercontent.com/keneucker/biketag-website/production/public/img/imgur-logo.png\n  [sanity-image]: https://raw.githubusercontent.com/keneucker/biketag-website/production/public/img/sanity-logo.png\n\u003c/div\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeneucker%2Fbiketag-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeneucker%2Fbiketag-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeneucker%2Fbiketag-api/lists"}