{"id":28125024,"url":"https://github.com/passport/todos-express-twitter","last_synced_at":"2025-05-14T09:19:54.112Z","repository":{"id":55137713,"uuid":"39281883","full_name":"passport/todos-express-twitter","owner":"passport","description":"Express 4.x app using Passport for sign in with Twitter.","archived":false,"fork":false,"pushed_at":"2023-05-10T13:45:39.000Z","size":418,"stargazers_count":106,"open_issues_count":5,"forks_count":56,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-08T01:33:43.507Z","etag":null,"topics":["express","passport","twitter"],"latest_commit_sha":null,"homepage":"","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/passport.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}},"created_at":"2015-07-18T01:06:29.000Z","updated_at":"2024-05-03T17:58:52.000Z","dependencies_parsed_at":"2024-04-15T01:56:13.743Z","dependency_job_id":"fd1f0cb7-6a0a-42cc-9828-1caa6ab837d7","html_url":"https://github.com/passport/todos-express-twitter","commit_stats":{"total_commits":36,"total_committers":3,"mean_commits":12.0,"dds":0.05555555555555558,"last_synced_commit":"5a9626e70fc0fdd99a3f68e6741991aba32ef763"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passport%2Ftodos-express-twitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passport%2Ftodos-express-twitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passport%2Ftodos-express-twitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passport%2Ftodos-express-twitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/passport","download_url":"https://codeload.github.com/passport/todos-express-twitter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253728605,"owners_count":21954452,"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":["express","passport","twitter"],"created_at":"2025-05-14T09:19:52.592Z","updated_at":"2025-05-14T09:19:54.102Z","avatar_url":"https://github.com/passport.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"This example illustrates how to use [Express](https://expressjs.com) 4.x and\n[Passport](https://www.passportjs.org) to sign users in with [Twitter](https://twitter.com).\nUse this example as a starting point for your own web applications.\n\n## Quick Start\n\nTo get started with this example, clone the repository and install the\ndependencies.\n\n```bash\n$ git clone git@github.com:passport/express-4.x-twitter-example.git\n$ cd express-4.x-twitter-example\n$ npm install\n```\n\nThis example requires credentials from Twitter, which can be obtained by\n[creating](https://developer.twitter.com/en/docs/apps/overview) an app in the\ndeveloper portal's [App page](https://developer.twitter.com/en/apps).  The\ncallback URL of the app should be set to: `http://localhost:3000/oauth/callback/twitter.com`\n\nOnce credentials have been obtained, create a `.env` file and add the following\nenvironment variables:\n\n```\nTWITTER_CONSUMER_KEY={{INSERT_API_KEY_HERE}}\nTWITTER_CONSUMER_SECRET={{INSERT_API_SECRET_KEY_HERE}}\n```\n\nStart the server.\n\n```bash\n$ npm start\n```\n\nNavigate to [`http://localhost:3000`](http://localhost:3000).\n\n## Overview\n\nThis example illustrates how to use [Passport](https://www.passportjs.org) and\nthe [`passport-twitter`](https://www.passportjs.org/packages/passport-twitter/)\nstrategy within an [Express](https://expressjs.com) application to sign users in\nwith [Twitter](https://twitter.com).\n\nThe example builds upon the scaffolding created by [Express generator](https://expressjs.com/en/starter/generator.html),\nand uses [EJS](https://ejs.co) as a view engine and plain CSS for styling.  This\nscaffolding was generated by executing:\n\n```\n$ express --view ejs express-4.x-twitter-example\n```\n\nThe example uses [SQLite](https://www.sqlite.org) for storing user accounts.\nSQLite is a lightweight database that works well for development, including this\nexample.\n\nAdded to the scaffolding are files which add authentication to the application.\n\n* [`boot/db.js`](boot/db.js)\n\n  This file initializes the database by creating the tables used to store user\n  accounts and credentials.\n\n* [`boot/auth.js`](boot/auth.js)\n\n  This file initializes Passport.  It configures the Twitter strategy and\n  supplies the serialization functions used for session management.\n\n* [`routes/auth.js`](routes/auth.js)\n\n  This file defines the routes used for authentication.  In particular, there\n  are three routes used to authenticate with Twitter:\n  \n  - `GET /login`\n  \n    This route renders a page that prompts the user to sign in with Twitter.\n  \n  - `GET /login/federated/twitter.com`\n  \n    This route begins the authentication sequence by redirecting the user to\n    Twitter.\n  \n  - `POST /oauth/callback/twitter.com`\n  \n    This route completes the authentication sequence when Twitter redirects the\n    user back to the application.  When a new user signs in, a user account is\n    automatically created and their Twitter account is linked.  When an existing\n    user returns, they are signed in to their linked account.\n\n## License\n\n[The Unlicense](https://opensource.org/licenses/unlicense)\n\n\n[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpassport%2Ftodos-express-twitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpassport%2Ftodos-express-twitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpassport%2Ftodos-express-twitter/lists"}