{"id":17349388,"url":"https://github.com/iambumblehead/pkce-pair","last_synced_at":"2025-03-27T11:44:44.896Z","repository":{"id":57325262,"uuid":"419077691","full_name":"iambumblehead/pkce-pair","owner":"iambumblehead","description":"pkce-pair creation and validation in node and browser runtimes","archived":false,"fork":false,"pushed_at":"2021-10-20T15:29:35.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T11:57:54.489Z","etag":null,"topics":["code-challenge","oauth2","pkce"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/iambumblehead.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}},"created_at":"2021-10-19T20:14:50.000Z","updated_at":"2021-11-02T06:41:05.000Z","dependencies_parsed_at":"2022-09-18T21:38:33.251Z","dependency_job_id":null,"html_url":"https://github.com/iambumblehead/pkce-pair","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iambumblehead%2Fpkce-pair","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iambumblehead%2Fpkce-pair/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iambumblehead%2Fpkce-pair/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iambumblehead%2Fpkce-pair/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iambumblehead","download_url":"https://codeload.github.com/iambumblehead/pkce-pair/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245841691,"owners_count":20681184,"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":["code-challenge","oauth2","pkce"],"created_at":"2024-10-15T16:55:52.745Z","updated_at":"2025-03-27T11:44:44.874Z","avatar_url":"https://github.com/iambumblehead.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"pkce-pair\n=========\n**(c)[Bumblehead][0]**\n\n[![npm version](https://badge.fury.io/js/pkce-pair.svg)](https://badge.fury.io/js/pkce-pair) [![Build Status](https://github.com/iambumblehead/pkce-pair/workflows/nodejs-ci/badge.svg)][2]\n\nCreates and validates [PKCE-pairs][12] for node and browser environments. `pkce-pair` copies from projects [here][10] and [here.][11] PKCE-pair brings together a few things missing from other PKCE packages out there,\n  * works with node and browser crypto,\n  * returns Promises and not callbacks to use browser `window.crypto`\n\nIf you're using PKCE pairs in a node server environment _only_ and not a browser environment, [consider using the pkce-challenge package][11] to generate synchronous pkce values instead (browser `window.crypto` is asynchronous).\n\n[10]: https://github.com/coolgk/utils/\n[11]: https://github.com/crouchcd/pkce-challenge\n[12]: https://datatracker.ietf.org/doc/html/rfc7636#section-4.1\n\n\n\n```javascript\nimport pkcePair, {\n  create,\n  createVerifier,\n  createChallenge,\n  isVerified\n} from 'pkce-pair';\n```\n\ncall imported functions with a node or browser `crypto` object,\n```javascript\nimport pkcePair from 'pkce-pair';\nimport crypto from 'crypto';\n\nconst pair = await pkcePair(crypto);\nconst isVerified = await isVerified(crypto, pair.verifier, pair.challenge);\n\nconsole.log(isVerified); // true\n```\n\nanother example, using browser `window.crypto`\n```javascript\nimport pkcePair from 'pkce-pair';\n\nconst pair = await pkcePair(window.crypto);\nconst challenge = await pkcePair.createChallenge(window.crypto, pair.verifier);\nconst isVerified = await isVerified(window.crypto, pair.verifier, challenge);\n\nconsole.log(isVerified); // true\n```\n\n\n\n![scrounge](https://github.com/iambumblehead/scroungejs/raw/master/img/hand.png)\n\n(The MIT License)\n\nCopyright (c) [Bumblehead][0] \u003cchris@bumblehead.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n[0]: http://www.bumblehead.com                            \"bumblehead\"\n[2]: https://github.com/iambumblehead/pkce-pair \"pkce-pair\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiambumblehead%2Fpkce-pair","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiambumblehead%2Fpkce-pair","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiambumblehead%2Fpkce-pair/lists"}