simple-auth0
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

simple-auth0

Wrapper around the [auth0-js] and [auth0-lock] libraries to provide a simple authentication package reusable across applications.

Usage

Install via npm:

npm install --save simple-auth0

Use with this trial code:

import createAuth0Client from "simple-auth0";

const auth0 = createAuth0Client({
  clientID: "",
  domain: "",
  audience: "",
  assembleUser: (profile, accessToken) => {
    return {
      name: profile.name,
      accessToken
    }
  },
  lockTheme: {
    logo: "",
    primaryColor: "#000000",
    backgroundColor: "#000000"
  },
  lockTitle: "My Application"
});

auth0
  .currentUser()
  .then(({ user }) => {
    // sample logic
    if (user) {
      // redirect to login screen
    } else {
      // start authenticated app
    }
  })

Readme

Keywords

none

Package Sidebar

Install

npm i simple-auth0

Weekly Downloads

0

Version

0.0.4

License

ISC

Unpacked Size

14.4 kB

Total Files

6

Last publish

Collaborators

  • nlx-inc