{"id":21411886,"url":"https://github.com/talha-t/twitch-wrapper-ts","last_synced_at":"2025-07-14T02:32:01.891Z","repository":{"id":57149254,"uuid":"115916785","full_name":"Talha-T/twitch-wrapper-ts","owner":"Talha-T","description":"Twitch Chat and API Implementation for Typescript","archived":false,"fork":false,"pushed_at":"2018-11-11T13:23:05.000Z","size":4385,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-19T20:54:56.280Z","etag":null,"topics":["twitch-api","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/twitch-wrapper-ts","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/Talha-T.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":"2018-01-01T12:06:47.000Z","updated_at":"2024-05-23T13:43:57.000Z","dependencies_parsed_at":"2022-09-06T14:51:47.612Z","dependency_job_id":null,"html_url":"https://github.com/Talha-T/twitch-wrapper-ts","commit_stats":null,"previous_names":["talha-t/twitch.ts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talha-T%2Ftwitch-wrapper-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talha-T%2Ftwitch-wrapper-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talha-T%2Ftwitch-wrapper-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talha-T%2Ftwitch-wrapper-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Talha-T","download_url":"https://codeload.github.com/Talha-T/twitch-wrapper-ts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225941814,"owners_count":17549070,"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":["twitch-api","typescript"],"created_at":"2024-11-22T17:48:04.136Z","updated_at":"2024-11-22T17:48:04.756Z","avatar_url":"https://github.com/Talha-T.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# twitch-wrapper-ts\n#### Twitch Chat \u0026 API Wrapper for Node.js Typescript\n[![NPM](https://nodei.co/npm/twitch-wrapper-ts.png)](https://nodei.co/npm/twitch-wrapper-ts/)\n---\n\n### Features:\n- Very simple to use, both chat wise and API wise.\n- Strongly typed API results.\n\n[Bot Example](https://github.com/Talha-T/twitch-bot)\n\n### Installation:\n`npm install twitch-wrapper-ts`\n\n### How to Use:\nAfter installing the package, getting chat is as easy as this:\n```js\nimport { Twitch, Message, ChannelUserState } from \"twitch-wrapper-ts\";\n\nconst twitch: Twitch = new Twitch(\"username\", \"token\", \"channelnames\", \"seperated\");\n\ntwitch.connect();\ntwitch.on(\"connected\", () =\u003e twitch.send(\"Connected!!\", \"somechannel\"));\ntwitch.on(\"message\", (message: Message, channelState: ChannelUserState) =\u003e console.log(message));\n    \n/*\nMessage {\n  badges: '',\n  color: '#00FF7F',\n  displayName: 'kutsalouse',\n  emotes: '',\n  id: '325003d6-aad3-41c5-aa89-d6ee9c56efd7',\n  mod: true,\n  roomId: 69223356,\n  subscriber: true,\n  tmiSentTs: 1515006994874,\n  turbo: true,\n  userId: 47954587,\n  userType: '',\n  content: 'drop var alt tab yapma artık',\n  channel: '#only35support',\n  broadcaster:\n   Broadcaster {\n     emoteOnly: true,\n     followersOnly: -1,\n     mercury: true,\n     r9k: true,\n     rituals: true,\n     roomId: 69223356,\n     slow: true,\n     subsOnly: true,\n     broadcasterLang: '' }\n}\n*/\n```\n\nStrongly typed API calls (Fully documented in the Intellisense) :\n```ts\nimport { ApiRequester } from \"twitch-wrapper-ts\";\nconst twitchApi = new TwitchApi(clientId, oauth);\nconst users = await twitchApi.users.get({\n    login: \"implicit1\",\n});\n\nconst followData = await twitchApi.users.follows.get({\n    from_id: users.data[0].id,\n});\n/*\n{ total: 63,\n  data:\n   [ { fromId: '69056964',\n       toId: '30080751',\n       followedAt: '2018-02-10T16:52:34Z' },\n       ...\n   ]\n}\n*/\n```\n\nError handling:\n```ts\ntry {\n    //something\n} catch (err) {\n    console.log(err.response);\n}\n// { error: 'Service Unavailable', status: 503, message: '' }\n```\n\n### Important Notes.\n- Do not include the prefix `oauth:` in your oauth password.\n- If you do not have one, get it here: http://twitchapps.com/tmi/\n- Including # or not in the channel does NOT matter.\n- Currently you can get detailed information in IntelliSense, documententation will be added soon.\n- As an exception for the clips endpoint, you have to cast your data from `IClip` as here:\n```ts\nconst clip = await twitchApi.clips.get({\n    id: \"AwkwardHelplessSalamanderSwiftRage\",\n});\nconst clips = clip.data.map((clipV) =\u003e clipV as Clip);\nconsole.log(clips[0].embedUrl);\n```\n- If you cannot make something work, be sure to check the summary comments for it.\n\n### Extra Contact:\nImplicit#8954 on Discord, talha6851@hotmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalha-t%2Ftwitch-wrapper-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftalha-t%2Ftwitch-wrapper-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalha-t%2Ftwitch-wrapper-ts/lists"}