{"_id":"@appterm-labs/nest-apple-verify","_rev":"3-65267f089120613e23789a47db90e5ed","name":"@appterm-labs/nest-apple-verify","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"@appterm-labs/nest-apple-verify","version":"0.0.1","author":{"name":"Ege Sabanci","email":"esabanci@appterm.co"},"license":"UNLICENSED","_id":"@appterm-labs/nest-apple-verify@0.0.1","maintainers":[{"name":"appterm-labs","email":"mail@appterm.co"}],"dist":{"shasum":"0ad6b019c35e180c3c9dddab05fd019909ac46c1","tarball":"https://registry.npmjs.org/@appterm-labs/nest-apple-verify/-/nest-apple-verify-0.0.1.tgz","fileCount":20,"integrity":"sha512-UIbV9in83mFrmb5qEsgfisL8I+c0VhPJMy6AK8fPxQ13AomE452a3i5hU96xtjoqekCAaYigNxvsnWNEDmj2wg==","signatures":[{"sig":"MEQCIA/oo2uSWdKpGE/V9HG7zAdoBGhkwV3HkrYzh00VHxsSAiAuretgKufvRgyT6U0YULeVzQvluxNDKvHUR7V39A1fiA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":118063},"jest":{"roots":["<rootDir>/src/","<rootDir>/libs/"],"rootDir":".","testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"testEnvironment":"node","moduleNameMapper":{"^@nest-apple-verify/nest-apple-verify(|/.*)$":"<rootDir>/libs/nest-apple-verify/src/$1"},"coverageDirectory":"./coverage","collectCoverageFrom":["**/*.(t|j)s"],"moduleFileExtensions":["js","json","ts"]},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"6e4505c2f124b7bae996fddeee7f7354e6b99f1d","scripts":{"lint":"eslint \"{src,apps,libs,test}/**/*.ts\" --fix","build":"nest build","format":"prettier --write \"src/**/*.ts\" \"test/**/*.ts\" \"libs/**/*.ts\"","build:lib":"tsc -p libs/nest-apple-verify/tsconfig.lib.json"},"_npmUser":{"name":"appterm-labs","email":"mail@appterm.co"},"_npmVersion":"11.0.0","description":"NestJS module for verify Apple Sign-in identifier-token (idToken)","directories":{},"_nodeVersion":"23.1.0","dependencies":{"rxjs":"^7.8.1","jwks-rsa":"^3.2.0","@nestjs/core":"^10.0.0","jsonwebtoken":"^9.0.2","@nestjs/common":"^10.0.0","reflect-metadata":"^0.2.0","@nestjs/platform-express":"^10.0.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","eslint":"^8.0.0","ts-jest":"^29.1.0","ts-node":"^10.9.1","prettier":"^3.0.0","supertest":"^7.0.0","ts-loader":"^9.4.3","typescript":"^5.1.3","@nestjs/cli":"^10.0.0","@types/jest":"^29.5.2","@types/node":"^20.3.1","@types/express":"^5.0.0","tsconfig-paths":"^4.2.0","@nestjs/testing":"^10.0.0","@types/supertest":"^6.0.0","@nestjs/schematics":"^10.0.0","source-map-support":"^0.5.21","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.0","@typescript-eslint/parser":"^8.0.0","@typescript-eslint/eslint-plugin":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/nest-apple-verify_0.0.1_1747403341565_0.8566151324792668","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@appterm-labs/nest-apple-verify","version":"0.0.2","author":{"name":"Ege Sabanci","email":"esabanci@appterm.co"},"license":"WTFPL","_id":"@appterm-labs/nest-apple-verify@0.0.2","maintainers":[{"name":"appterm-labs","email":"mail@appterm.co"}],"dist":{"shasum":"3eb7ab6d0316bc0b2788c7a9791015beeb1d8f25","tarball":"https://registry.npmjs.org/@appterm-labs/nest-apple-verify/-/nest-apple-verify-0.0.2.tgz","fileCount":22,"integrity":"sha512-g8Vo5CtHrttRuolkLUGKVgpzgDy9/lejRFbCPVcOwzGgPOM7zypgH0rvEvSlUXK8CFXhrqM6zsJhuO6xUhlYXQ==","signatures":[{"sig":"MEUCIQC4swCsiv19qpWoo6WrYmZvm0dhfUOROxmcnBPSJPIB/gIgC+w+3sKne6ecLBpFm6n4+ZHnHhdMr7eG9xbJIwly+fw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":120647},"jest":{"roots":["<rootDir>/src/","<rootDir>/libs/"],"rootDir":".","testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"testEnvironment":"node","moduleNameMapper":{"^@nest-apple-verify/nest-apple-verify(|/.*)$":"<rootDir>/libs/nest-apple-verify/src/$1"},"coverageDirectory":"./coverage","collectCoverageFrom":["**/*.(t|j)s"],"moduleFileExtensions":["js","json","ts"]},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"ce0dc9d760bf4f6b81dab436cf40ace6a653e1e4","scripts":{"lint":"eslint \"{src,apps,libs,test}/**/*.ts\" --fix","build":"nest build","format":"prettier --write \"src/**/*.ts\" \"test/**/*.ts\" \"libs/**/*.ts\"","build:lib":"tsc -p libs/nest-apple-verify/tsconfig.lib.json"},"_npmUser":{"name":"appterm-labs","email":"mail@appterm.co"},"_npmVersion":"11.0.0","description":"NestJS module for verify Apple Sign-in identifier-token (idToken)","directories":{},"_nodeVersion":"23.1.0","dependencies":{"rxjs":"^7.8.1","jwks-rsa":"^3.2.0","@nestjs/core":"^10.0.0","jsonwebtoken":"^9.0.2","@nestjs/common":"^10.0.0","reflect-metadata":"^0.2.0","@nestjs/platform-express":"^10.0.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","eslint":"^8.0.0","ts-jest":"^29.1.0","ts-node":"^10.9.1","prettier":"^3.0.0","supertest":"^7.0.0","ts-loader":"^9.4.3","typescript":"^5.1.3","@nestjs/cli":"^10.0.0","@types/jest":"^29.5.2","@types/node":"^20.3.1","@types/express":"^5.0.0","tsconfig-paths":"^4.2.0","@nestjs/testing":"^10.0.0","@types/supertest":"^6.0.0","@nestjs/schematics":"^10.0.0","source-map-support":"^0.5.21","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.0","@typescript-eslint/parser":"^8.0.0","@typescript-eslint/eslint-plugin":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/nest-apple-verify_0.0.2_1747437179033_0.04881724854307845","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"author":{"name":"Ege Sabanci","email":"esabanci@appterm.co"},"name":"@appterm-labs/nest-apple-verify","version":"0.0.3","description":"NestJS module for verify Apple Sign-in identifier-token (idToken)","main":"libs/nest-apple-verify/dist/index.js","types":"libs/nest-apple-verify/dist/index.d.ts","exports":{".":{"types":"./libs/nest-apple-verify/dist/index.d.ts","require":"./libs/nest-apple-verify/dist/index.js","import":"./libs/nest-apple-verify/dist/index.js"}},"license":"WTFPL","scripts":{"build":"nest build","build:lib":"tsc -p libs/nest-apple-verify/tsconfig.lib.json","lint":"eslint \"{src,apps,libs,test}/**/*.ts\" --fix"},"dependencies":{"@nestjs/common":"^10.0.0","@nestjs/core":"^10.0.0","@nestjs/platform-express":"^10.0.0","jsonwebtoken":"^9.0.2","jwks-rsa":"^3.2.0","reflect-metadata":"^0.2.0","rxjs":"^7.8.1"},"devDependencies":{"@nestjs/cli":"^10.0.0","@nestjs/schematics":"^10.0.0","@nestjs/testing":"^10.0.0","@types/express":"^5.0.0","@types/jest":"^29.5.2","@types/node":"^20.3.1","@types/supertest":"^6.0.0","@typescript-eslint/eslint-plugin":"^8.0.0","@typescript-eslint/parser":"^8.0.0","eslint":"^8.0.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.0","jest":"^29.5.0","prettier":"^3.0.0","source-map-support":"^0.5.21","supertest":"^7.0.0","ts-jest":"^29.1.0","ts-loader":"^9.4.3","ts-node":"^10.9.1","tsconfig-paths":"^4.2.0","typescript":"^5.1.3"},"jest":{"moduleFileExtensions":["js","json","ts"],"rootDir":".","testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"collectCoverageFrom":["**/*.(t|j)s"],"coverageDirectory":"./coverage","testEnvironment":"node","roots":["<rootDir>/src/","<rootDir>/libs/"],"moduleNameMapper":{"^@nest-apple-verify/nest-apple-verify(|/.*)$":"<rootDir>/libs/nest-apple-verify/src/$1"}},"_id":"@appterm-labs/nest-apple-verify@0.0.3","gitHead":"fe318b9f946e7c1652dfde59f3ce938831586529","_nodeVersion":"23.1.0","_npmVersion":"11.0.0","dist":{"integrity":"sha512-mzOBMAdvR6wOMEsErcTi7HOws8wpOX/JaxcuGmJ3WcuzzQC3idtvIqInj7jQDDmXgx428Ftk7M+yUfmXVv0dxA==","shasum":"930e73581241b30dd46d7ebe0e6edaaa768670a2","tarball":"https://registry.npmjs.org/@appterm-labs/nest-apple-verify/-/nest-apple-verify-0.0.3.tgz","fileCount":22,"unpackedSize":120821,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDNYQVpMEKZ7ZhLR6M+dAqjpjmqO1JsKqRgQmzzh9BzmAIhANYOEf6L3dgRBj5y/9QxkQQKb9/zENadfDgXBqa7Yl65"}]},"_npmUser":{"name":"appterm-labs","email":"mail@appterm.co"},"directories":{},"maintainers":[{"name":"appterm-labs","email":"mail@appterm.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nest-apple-verify_0.0.3_1747612272378_0.19817333109629942"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-16T13:49:01.485Z","modified":"2025-05-18T23:51:12.706Z","0.0.1":"2025-05-16T13:49:01.748Z","0.0.2":"2025-05-16T23:12:59.205Z","0.0.3":"2025-05-18T23:51:12.550Z"},"author":{"name":"Ege Sabanci","email":"esabanci@appterm.co"},"license":"WTFPL","description":"NestJS module for verify Apple Sign-in identifier-token (idToken)","maintainers":[{"name":"appterm-labs","email":"mail@appterm.co"}],"readme":"# nest-apple-verify\n\nA simple NestJS module for verifying Apple ID tokens.\n\n## Installation\n\n```bash\nnpm install nest-apple-verify\n```\n\nOr with yarn:\n\n```bash\nyarn add nest-apple-verify\n```\n\n## Usage\n\n### Import the module\n\n```typescript\nimport { Module } from '@nestjs/common';\nimport { NestAppleVerifyModule } from 'nest-apple-verify';\n\n@Module({\n  imports: [NestAppleVerifyModule],\n})\nexport class AppModule {}\n```\n\n### Inject and use the service\n\n```typescript\nimport { Injectable } from '@nestjs/common';\nimport { NestAppleVerifyService } from 'nest-apple-verify';\n\n@Injectable()\nexport class AuthService {\n  constructor(private readonly appleVerifyService: NestAppleVerifyService) {}\n\n  async verifyAppleToken(token: string): Promise<any> {\n    // Optionally pass your app's client ID as the second parameter for audience validation\n    const payload = await this.appleVerifyService.verifyIdToken(token, 'your.apple.client.id');\n    \n    // If verification fails, an UnauthorizedException is thrown\n    // If successful, the decoded token payload is returned\n    return payload;\n  }\n}\n```\n\n## API\n\n### NestAppleVerifyService\n\n#### verifyIdToken(idToken: string, aud?: string): Promise<string | jwt.JwtPayload>\n\nVerifies an Apple ID token.\n\nParameters:\n- `idToken`: The Apple ID token to verify\n- `aud` (optional): The audience (client ID) to validate against\n\nReturns:\n- A promise that resolves to the token payload if verification is successful\n- Throws `UnauthorizedException` if verification fails\n\n## How it works\n\nThis module:\n1. Fetches Apple's public keys from their JWKS endpoint\n2. Decodes the provided ID token to get the key ID (kid)\n3. Retrieves the corresponding public key\n4. Verifies the token signature and validates claims\n5. Returns the decoded token payload or throws an exception\n\n## License\n\n```\nCopyright (C) 2025 Ege Sabanci <esabanci@appterm.co>\n\nEveryone is permitted to copy and distribute verbatim or modified\ncopies of this license document, and changing it is allowed as long\nas the name is changed.\n\n           DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE\n  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n 0. You just DO WHAT THE FUCK YOU WANT TO.\n```","readmeFilename":"README.md"}