{"_id":"@bolomio/cognito-authorizer","name":"@bolomio/cognito-authorizer","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@bolomio/cognito-authorizer","version":"1.0.0","description":"functions to authorize to amazon cognito","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test":"jest -w 1","build":"tsc -p tsconfig.dist.json","release":"npm run build && semantic-release","format":"bash -c 'prettier \"**/*.{ts,tsx,js,jsx,json,yml,yaml}\" --ignore-path <(cat .gitignore .prettierignore) --write'","lint":"eslint --ignore-path .eslintignore --ext .js,.ts ."},"keywords":[],"author":{"name":"bolomio"},"license":"ISC","publishConfig":{"access":"public"},"devDependencies":{"@semantic-release/changelog":"^6.0.3","@semantic-release/git":"^10.0.1","@semantic-release/github":"^8.1.0","@semantic-release/npm":"^10.0.4","@types/jest":"^29.5.2","@typescript-eslint/eslint-plugin":"^5.59.8","@typescript-eslint/parser":"^5.59.8","eslint":"^8.41.0","eslint-config-prettier":"^8.8.0","eslint-import-resolver-typescript":"^3.5.5","eslint-plugin-import":"^2.27.5","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","nock":"^13.2.9","prettier":"^2.8.8","semantic-release":"^21.0.2","ts-jest":"^29.1.0","typescript":"^5.0.4"},"dependencies":{"got":"^11.8.6","tslib":"^2.5.2"},"_id":"@bolomio/cognito-authorizer@1.0.0","gitHead":"69b22782cf953d0ed96a92b1742ffbe174285f09","_nodeVersion":"18.19.1","_npmVersion":"9.9.2","dist":{"integrity":"sha512-Y/e/9H357fnLO9J6duOofQlWLysfgz1OLHOz5vMzk15+syaaanjeupUonvcRzJCt7lBEvhgFEyVvObxLKJmP6Q==","shasum":"8a2dabeb00b04e660bab768a90dca4f2fcab7aad","tarball":"https://registry.npmjs.org/@bolomio/cognito-authorizer/-/cognito-authorizer-1.0.0.tgz","fileCount":12,"unpackedSize":46415,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLmI/rC0QWe4ffKK5sCTIuQ3y5ajEv7pz1PO+jbTqKOgIhAOTl97kOaln2BRjpjA5UaIVV6bFnnsyYZsd/uJbSh2NA"}]},"_npmUser":{"name":"marcusyami","email":"marcus.yavorskyy@gmail.com"},"directories":{},"maintainers":[{"name":"romulogmp","email":"romulogmp@gmail.com"},{"name":"marcusyami","email":"marcus.yavorskyy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cognito-authorizer_1.0.0_1708983951926_0.7574067321805305"},"_hasShrinkwrap":false}},"time":{"created":"2024-02-26T21:45:51.821Z","1.0.0":"2024-02-26T21:45:52.087Z","modified":"2024-02-26T21:45:52.662Z"},"maintainers":[{"name":"romulogmp","email":"romulogmp@gmail.com"},{"name":"marcusyami","email":"marcus.yavorskyy@gmail.com"}],"description":"functions to authorize to amazon cognito","keywords":[],"author":{"name":"bolomio"},"license":"ISC","readme":"# [bolomio] Cognito Authorizer\n\n[![GitHub Repo](https://img.shields.io/badge/GitHub-Repository-blue?logo=github)](https://github.com/bolomio/cognito-authorizer)\n[![npm version](https://badge.fury.io/js/%40bolomio%2Fcognito-authorizer.svg)](https://www.npmjs.com/package/@bolomio/cognito-authorizer)\n\nThe @bolomio/cognito-authorizer package is an open-source lightweight npm package that provides functions for authenticating with cognito using different authentication flows. It allows you to easily authenticate cognito instances in your Node.js applications.\n\n## Features\n\n- Authenticate with cognito using the client credential flow\n\n## Installation\n\nYou can install the package using npm:\n\n```bash\nnpm install @bolomio/cognito-authorizer\n```\n\n## Usage\n\n```javascript\nconst { makeCognitoAuthorizer } = require('@bolomio/cognito-authorizer');\nconst { HTTPError } = require('got');\n\n// Create an instance of the cognito authorizer with custom options\nconst authorizer = makeCognitoAuthorizer({\n  baseUrl: \"https://{domain-name}.auth.{region}.amazoncognito.com/\",\n});\n\nasync function authenticate() {\n  try {\n    const resource = await authorizer.authenticateWithClientCredentials({\n      clientId: 'YOUR_CLIENT_ID',\n      clientSecret: 'YOUR_CLIENT_SECRET',\n    });\n    console.log(resource);\n  } catch (e) {\n    if (e instanceof HTTPError) {\n      console.log(e.response.body);\n    }\n  }\n}\n\nauthenticate();\n```\n\n## Contributing\n\nContributions are welcome! If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request. Make sure to follow the [contribution guidelines](./CONTRIBUTING.md).\n\n## License\n\nThis project is licensed under the [GNU General Public License](LICENSE).\n","readmeFilename":"README.md"}