{"id":16588411,"url":"https://github.com/oliverjash/twitter-api-ts","last_synced_at":"2025-03-21T13:31:07.075Z","repository":{"id":146158277,"uuid":"91799947","full_name":"OliverJAsh/twitter-api-ts","owner":"OliverJAsh","description":"TypeScript compatible Twitter API client","archived":false,"fork":false,"pushed_at":"2018-08-11T18:13:29.000Z","size":110,"stargazers_count":64,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-01T06:42:02.277Z","etag":null,"topics":["api-client","javascript","twitter","twitter-api","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OliverJAsh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-05-19T11:38:19.000Z","updated_at":"2024-10-29T07:28:33.000Z","dependencies_parsed_at":"2023-03-30T08:22:51.477Z","dependency_job_id":null,"html_url":"https://github.com/OliverJAsh/twitter-api-ts","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OliverJAsh%2Ftwitter-api-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OliverJAsh%2Ftwitter-api-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OliverJAsh%2Ftwitter-api-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OliverJAsh%2Ftwitter-api-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OliverJAsh","download_url":"https://codeload.github.com/OliverJAsh/twitter-api-ts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244141600,"owners_count":20404835,"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","javascript","twitter","twitter-api","typescript"],"created_at":"2024-10-11T22:56:38.664Z","updated_at":"2025-03-21T13:31:07.068Z","avatar_url":"https://github.com/OliverJAsh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# twitter-api-ts\n\nTypScript compatible Twitter API client.\n\n- [io-ts] is used to perform IO validation for type safety.\n- [fp-ts] is used for its `Task`, `Either`, and `Option` types.\n- Request functions return types of `type Response\u003cT\u003e = either.Either\u003cErrorResponse, T\u003e`.\n\nThis library is written in TypeScript and is published in JavaScript with type declaration files.\n\n## Installation\n\n```\nyarn add twitter-api-ts\n```\n\n## Example\n\n``` ts\nimport { fetchHomeTimeline } from 'twitter-api-ts';\nimport * as option from 'fp-ts/lib/Option';\n\nconst CONSUMER_KEY = 'YOUR_CONSUMER_KEY';\nconst CONSUMER_SECRET = 'YOUR_CONSUMER_SECRET';\nconst TOKEN = 'YOUR_TOKEN';\nconst TOKEN_SECRET = 'YOUR_TOKEN_SECRET';\n\nfetchHomeTimeline({\n    oAuth: {\n        consumerKey: CONSUMER_KEY,\n        consumerSecret: CONSUMER_SECRET,\n        token: option.some(TOKEN),\n        tokenSecret: option.some(TOKEN_SECRET),\n    },\n    query: {\n        count: option.some(50),\n    },\n})\n    // We use fp-ts’ Task type, which is lazy. Running the task returns a\n    // promise.\n    .run()\n    .then(response =\u003e {\n        console.log(response);\n        // =\u003e Either\u003cErrorResponse, TwitterAPITimelineResponseT\u003e\n    });\n```\n\n## Development\n\n```\nyarn\nyarn compile\nyarn lint\n```\n\n[io-ts]: https://github.com/gcanti/io-ts\n[fp-ts]: https://github.com/gcanti/fp-ts\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverjash%2Ftwitter-api-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foliverjash%2Ftwitter-api-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverjash%2Ftwitter-api-ts/lists"}