{"id":26252751,"url":"https://github.com/kinde-oss/js-utils","last_synced_at":"2025-06-10T21:36:12.515Z","repository":{"id":255357323,"uuid":"801183492","full_name":"kinde-oss/js-utils","owner":"kinde-oss","description":"A suite of functions and tools to handle tokens","archived":false,"fork":false,"pushed_at":"2025-04-23T17:25:17.000Z","size":1076,"stargazers_count":2,"open_issues_count":4,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-24T06:05:33.744Z","etag":null,"topics":["auth","authentication","jwt","oauth2"],"latest_commit_sha":null,"homepage":"http://www.kinde.com","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/kinde-oss.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2024-05-15T18:49:32.000Z","updated_at":"2025-04-23T17:25:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c601ff2-feff-4275-8320-9a3c1c29f834","html_url":"https://github.com/kinde-oss/js-utils","commit_stats":null,"previous_names":["kinde-oss/js-utils"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinde-oss%2Fjs-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinde-oss%2Fjs-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinde-oss%2Fjs-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinde-oss%2Fjs-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kinde-oss","download_url":"https://codeload.github.com/kinde-oss/js-utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250573354,"owners_count":21452350,"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":["auth","authentication","jwt","oauth2"],"created_at":"2025-03-13T17:28:09.136Z","updated_at":"2025-04-24T06:05:43.636Z","avatar_url":"https://github.com/kinde-oss.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kinde JS Utils\n\n## Description\n\nCollection of methods and helpers for usage interfacing with Kinde\n\n## Installation\n\n```bash\n# npm\nnpm install @kinde/js-utils\n# yarn\nyarn add @kinde/js-utils\n# pnpm\npnpm install @kinde/js-utils\n```\n\n## Usage\n\n### Methods\n\n`base64UrlEncode` - creates a base64 encoding of a string\n\n`sanitizeRedirect` - removes any trailing spaces from end of redirect URL\n\n`mapLoginMethodParamsForUrl` - Maps all the login options to their relevant url query param\n\n`generateAuthUrl` - builds a authentication URL to redirect users to start auth flow\n\n`extractAuthResults` - Extracts tokens and expiry from implcit flow response\n\n`generateRandomString` - Generates a random sring of a defined length\n\n### Session Managers\n\nexports `storageSettings` which can be used to configure the storage methods.\n\n```json\n{\n  \"keyPrefix\": \"kinde-\", // Prefix to be used on all storage items\n  \"maxLength\": 2000 // Max length of storage block, will auto split into separate chunks if needed\n}\n```\n\n#### Session storage types\n\n`MemoryStorage` - This holds the data in a simple memory store\n\n`ChromeStore` - This holds the data in chrome.store.local for use with Google Chrome extensions.\n\n`ExpoSecureStore` - Secure storage for Expo apps\n\n`LocalStorage` - For using localStorage Note: do not use for sensitive data\n\n### Token Helpers\n\nLinking in with the activeStorage, a number of token helpers are available.\n\n`setActiveStorage` - set the active storage manager\n\n`getActiveStorage` - get the current active storage manager\n\n#### Helpers\n\n`getClaim` - Get a single claim from the Access Token\n\n`getClaims` - Get all claims from the Access Token\n\n`getCurrentOrganization` - get the current authenticated organisation\n\n`getDecodedToken` - get the decoded id or access token\n\n`getFlag` - get a single feature flag\n\n`getPermission` - get a single permission value\n\n`getPermissions` - get all user permissions\n\n`getRoles` - get all the users roles\n\n`getUserOrganizations` - get all the organizations the user has access to\n\n`getUserProfile` - get the profile of the user from the ID token\n\n## Kinde documentation\n\n[Kinde Documentation](https://kinde.com/docs/) - Explore the Kinde docs\n\n## Contributing\n\nIf you'd like to contribute to this project, please follow these steps:\n\n1. Fork the repository.\n2. Create a new branch.\n3. Make your changes.\n4. Submit a pull request.\n\n## License\n\nBy contributing to Kinde, you agree that your contributions will be licensed under its MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkinde-oss%2Fjs-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkinde-oss%2Fjs-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkinde-oss%2Fjs-utils/lists"}