The SimpleJWT sjwt
library simplifies using simplejwt.com. It gives you simple tools for your end users to register, login, etc for a complete user management experience. All end users have an associated JSON store that you can access as well.
-
npm install sjwt
-
import {register} from 'sjwt';
-
const response = await register({email, password, projectId});
-
import {getAuthenticatedUser} from 'sjwt';
-
const user = await getAuthenticatedUser({projectId});
npm run build
creates thedist
directorynpm pack
creates a tar file- To test, in some other project's package.json dependencies, put
"sjwt": "file:<path to tgz file>"
Note, sometimes you need to clean npm's cache:
npm cache ls | grep sjwt
list all sjwt cache entriesnpm cache clean <an entry from above>
delete an entry
Note, you often need to remove checksums from package-lock.json as well