{"id":26519909,"url":"https://github.com/aidan-neel/auth","last_synced_at":"2026-02-18T02:03:13.457Z","repository":{"id":281761660,"uuid":"945313591","full_name":"aidan-neel/auth","owner":"aidan-neel","description":"Open-Source TypeScript authentication","archived":false,"fork":false,"pushed_at":"2025-03-27T00:23:45.000Z","size":50,"stargazers_count":1,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-20T20:42:17.282Z","etag":null,"topics":["auth","authentication","authorization","javascript","typecsript"],"latest_commit_sha":null,"homepage":"","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/aidan-neel.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":"2025-03-09T05:54:36.000Z","updated_at":"2025-03-27T00:23:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"f82c6af3-7daf-4e15-ac5a-2b3ce1216d47","html_url":"https://github.com/aidan-neel/auth","commit_stats":null,"previous_names":["aidan-neel/auth"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/aidan-neel/auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aidan-neel%2Fauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aidan-neel%2Fauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aidan-neel%2Fauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aidan-neel%2Fauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aidan-neel","download_url":"https://codeload.github.com/aidan-neel/auth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aidan-neel%2Fauth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29566366,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T00:47:08.760Z","status":"online","status_checked_at":"2026-02-18T02:00:09.468Z","response_time":162,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["auth","authentication","authorization","javascript","typecsript"],"created_at":"2025-03-21T11:35:04.390Z","updated_at":"2026-02-18T02:03:13.452Z","avatar_url":"https://github.com/aidan-neel.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## @aidan-neel/auth\n\n\u003cb\u003eOpen-Source TypeScript authentication\u003c/b\u003e\n\n\u003cimg src=\"https://img.shields.io/npm/v/@aidan-neel/auth/latest?style=flat-square\u0026label=version\" alt=\"NPM @aidan-neel/auth@latest\" /\u003e\n\n`@aidan-neel/auth` implements JWT-based authentication for support with Prisma ORM seamlessly.\n\n## Setup\n\n#### Prisma\n\nAdd the following lines to your `schema.prisma` file and install the prisma adapter\n\n```prisma\n// You can add anything else to it but these 6 are required\nmodel User {\n    id            Int       @id @default(autoincrement())\n    email         String    @unique\n    username      String\n    password      String\n    refreshTokens RefreshToken[]\n    @@map(\"users\")\n}\n\nmodel RefreshToken {\n    id        Int      @id @default(autoincrement())\n    token     String   @unique\n    user      User     @relation(fields: [userId], references: [id], onDelete: Cascade)\n    userId    Int      @map(\"user_id\")\n    expiresAt DateTime @map(\"expires_at\")\n    @@map(\"refresh_tokens\")\n}\n```\n\n## Install\n\n`npm install @aidan-neel/auth`\n\n## Usage\n\n#### Example with Prisma\n\nInstall the adapter\n`npm install @aidan-neel/auth-prisma`\n\n```js\nimport { Auth } from \"@aidan-neel/auth\";\nimport { PrismaAdapter } from \"@aidan-neel/auth-prisma\";\nimport { PrismaClient } from \"@prisma/client\";\n\nconst Prisma = new PrismaClient();\nconst auth = new Auth({\n\tadapter: new PrismaAdapter(Prisma),\n});\n\n// Register\nawait auth.registerUser(email, password);\n\n// Login\nconst { access_token, refresh_token } = await auth.loginUser(email, password);\n\n// Refresh Access Token\nconst { refreshed_access_token, refreshed_token } =\n\tawait auth.refreshAccessToken(refresh_token);\n\n// Logout\nawait auth.logoutUser(refreshed_token);\n```\n\n## Adapters\n\n-   `@aidan-neel/auth-postgresql`\n-   `@aidan-neel/auth-prisma`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faidan-neel%2Fauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faidan-neel%2Fauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faidan-neel%2Fauth/lists"}