0.18.3 • Published 4 months ago

@kinde/js-utils v0.18.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

Kinde JS Utils

Description

Collection of methods and helpers for usage interfacing with Kinde

Installation

# npm
npm install @kinde/js-utils
# yarn
yarn add @kinde/js-utils
# pnpm
pnpm install @kinde/js-utils

Usage

Methods

base64UrlEncode - creates a base64 encoding of a string

sanitizeRedirect - removes any trailing spaces from end of redirect URL

mapLoginMethodParamsForUrl - Maps all the login options to their relevant url query param

generateAuthUrl - builds a authentication URL to redirect users to start auth flow

extractAuthResults - Extracts tokens and expiry from implcit flow response

generateRandomString - Generates a random sring of a defined length

Session Managers

exports storageSettings which can be used to configure the storage methods.

{
  "keyPrefix": "kinde-", // Prefix to be used on all storage items
  "maxLength": 2000 // Max length of storage block, will auto split into separate chunks if needed
}

Session storage types

MemoryStorage - This holds the data in a simple memory store

ChromeStore - This holds the data in chrome.store.local for use with Google Chrome extensions.

ExpoSecureStore - Secure storage for Expo apps

LocalStorage - For using localStorage Note: do not use for sensitive data

Token Helpers

Linking in with the activeStorage, a number of token helpers are available.

setActiveStorage - set the active storage manager

getActiveStorage - get the current active storage manager

Helpers

getClaim - Get a single claim from the Access Token

getClaims - Get all claims from the Access Token

getCurrentOrganization - get the current authenticated organisation

getDecodedToken - get the decoded id or access token

getFlag - get a single feature flag

getPermission - get a single permission value

getPermissions - get all user permissions

getRoles - get all the users roles

getUserOrganizations - get all the organizations the user has access to

getUserProfile - get the profile of the user from the ID token

Kinde documentation

Kinde Documentation - Explore the Kinde docs

Contributing

If you'd like to contribute to this project, please follow these steps:

  1. Fork the repository.
  2. Create a new branch.
  3. Make your changes.
  4. Submit a pull request.

License

By contributing to Kinde, you agree that your contributions will be licensed under its MIT License.

0.5.0-1

11 months ago

0.14.1-2

6 months ago

0.14.1-1

6 months ago

0.14.1-4

6 months ago

0.10.0-1

7 months ago

0.14.1-3

6 months ago

0.10.0-3

7 months ago

0.10.0-2

7 months ago

0.13.0

6 months ago

0.17.0

5 months ago

0.14.1-0

6 months ago

0.17.1

5 months ago

0.7.2

8 months ago

0.7.1

9 months ago

0.7.3

8 months ago

0.4.2-2

11 months ago

0.7.0

9 months ago

0.4.2-0

11 months ago

0.5.1-0

11 months ago

0.5.1-2

11 months ago

0.5.1-1

11 months ago

0.18.1

5 months ago

0.18.2

4 months ago

0.18.3

4 months ago

0.10.1

7 months ago

0.14.0

6 months ago

0.18.0

5 months ago

0.13.0-0

6 months ago

0.10.0

7 months ago

0.5.1-4

11 months ago

0.5.1-3

11 months ago

0.5.1-5

11 months ago

0.8.0

8 months ago

0.10.2-1

7 months ago

0.10.2-0

7 months ago

0.10.2-3

7 months ago

0.10.2-2

7 months ago

0.11.0

7 months ago

0.7.3-0

8 months ago

0.6.0-2

11 months ago

0.10.2-4

7 months ago

0.6.0-1

11 months ago

0.15.0

6 months ago

0.6.0-6

11 months ago

0.6.0-5

11 months ago

0.6.0-4

11 months ago

0.6.0-3

11 months ago

0.18.0-0

5 months ago

0.16.0-8

5 months ago

0.16.0-9

5 months ago

0.16.0-4

5 months ago

0.16.0-5

5 months ago

0.16.0-6

5 months ago

0.16.0-7

5 months ago

0.16.0-0

6 months ago

0.16.0-3

6 months ago

0.9.0

8 months ago

0.5.0

11 months ago

0.7.2-8

9 months ago

0.10.1-0

7 months ago

0.10.1-1

7 months ago

0.7.2-1

9 months ago

0.12.0

6 months ago

0.7.2-0

9 months ago

0.7.2-3

9 months ago

0.7.2-2

9 months ago

0.7.2-5

9 months ago

0.16.0

5 months ago

0.7.2-4

9 months ago

0.7.2-7

9 months ago

0.7.2-6

9 months ago

0.17.1-4

5 months ago

0.17.1-2

5 months ago

0.17.1-3

5 months ago

0.17.1-0

5 months ago

0.17.1-1

5 months ago

0.12.0-0

7 months ago

0.6.0

10 months ago

0.5.0-0

12 months ago

0.4.1

1 year ago

0.4.0

1 year ago

0.3.0

1 year ago

0.3.0-7

1 year ago

0.3.0-6

1 year ago

0.3.0-8

1 year ago

0.3.0-3

1 year ago

0.3.0-4

1 year ago

0.2.0

1 year ago

0.2.0-21

1 year ago

0.2.0-20

1 year ago

0.2.0-19

1 year ago

0.2.0-18

1 year ago

0.2.0-17

1 year ago

0.2.0-16

1 year ago

0.2.0-15

1 year ago

0.2.0-14

1 year ago

0.2.0-13

1 year ago

0.2.0-11

1 year ago

0.2.0-6

1 year ago

0.2.0-10

1 year ago

0.2.0-5

1 year ago

0.2.0-4

1 year ago

0.2.0-2

1 year ago

0.2.0-12

1 year ago

0.2.0-9

1 year ago

0.2.0-8

1 year ago

0.2.0-7

1 year ago

0.1.0

1 year ago

0.1.0-5

1 year ago

0.1.0-4

1 year ago

0.1.0-7

1 year ago

0.1.0-6

1 year ago

0.1.0-1

1 year ago

0.1.0-3

1 year ago

0.1.0-0

1 year ago