{"id":22998275,"url":"https://github.com/uswitch/auth0-access-token","last_synced_at":"2025-04-02T13:24:07.672Z","repository":{"id":46175744,"uuid":"347933095","full_name":"uswitch/auth0-access-token","owner":"uswitch","description":"Fetches an acess token from auth0.","archived":false,"fork":false,"pushed_at":"2023-07-28T18:59:53.000Z","size":30,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-02-08T04:29:13.734Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/uswitch.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-03-15T10:54:36.000Z","updated_at":"2021-11-09T14:22:44.000Z","dependencies_parsed_at":"2022-07-20T16:02:35.493Z","dependency_job_id":null,"html_url":"https://github.com/uswitch/auth0-access-token","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uswitch%2Fauth0-access-token","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uswitch%2Fauth0-access-token/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uswitch%2Fauth0-access-token/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uswitch%2Fauth0-access-token/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uswitch","download_url":"https://codeload.github.com/uswitch/auth0-access-token/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246820820,"owners_count":20839304,"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":[],"created_at":"2024-12-15T06:12:33.845Z","updated_at":"2025-04-02T13:24:07.644Z","avatar_url":"https://github.com/uswitch.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# auth0-access-token\n## Installation and Usage\n`npm install --save auth0-access-token`\n\nGrab your credentials from Auth0. You can find them on your Auth0 application settings page.\n\n```javascript\nimport AuthClient from 'auth0-access-token'\n\nconst authClient = new AuthClient({\n    audience: 'YOUR_AUDIENCE'\n    clientId: 'YOUR_CLIENT_ID'\n    clientSecret: 'YOUR_CLIENT_SECRET'\n    url: 'YOUR_AUTH0_URL/oauth/token'\n  }\n})\n```\n\nAnd then you can get your token with `authClient.getToken()`\n\nHere's an example of how to get a token to use on a subsequent http request:\n```javascript\nconst fetchSecureData = async () =\u003e {\n  const token = await authClient.getToken()\n\n  axios({\n    method: 'POST',\n    url: '',\n    headers: { authorization: `Bearer ${token}` },\n    data: {...}\n  })\n}\n\n```\n## API\n\n| Interfaces | Description | Params |Returns\n| --- | --- | --- | --- |\n| `AuthClient` | Constructor method, use `new` keyword | `{audience, clientId clientSecret, url }` |client instance\n| `client.getToken` | Fetches token | empty |`Promise\u003cstring\u003e` |\n\n## Token request flow\n![image](https://user-images.githubusercontent.com/3267705/111351166-cd188380-867a-11eb-8ed9-93ae651cbcc2.png)\n\n## Development\nAfter you've made your changes to the package and pushed your branch, run:\n\n`npm version [patch|minor|major]`\n\nThis will automatically bump up the version and push  a new tag. If this is not done, the build will fail because npm doesn't allow publishing the  same version twice. Make sure to follow semantic versioning.\n\nLastly, merge your PR and that check the drone build. If all goes well, it should automatically publish the new version to `npm`.\n### TODO:\nMake it easier to test changes locally","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuswitch%2Fauth0-access-token","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuswitch%2Fauth0-access-token","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuswitch%2Fauth0-access-token/lists"}