Passage.js
Use our JavaScript library directly to build custom authentication flows.
Client SDK
Passage.js is our JavaScript library that is a building block for all Passage authentication and user management. This library contains primitives for adding user registration and login functionality to your website.
All Passage Elements use Passage.js and are the recommended way to add authentication to your website, but you can also build directly with Passage.js if you have custom requirements or use-cases that don't fit within an element. The library references are available here:
Setup
Via NPM
Install the @passageidentity/passage-js package via NPM.
Then you can import Passage.js into your code as follows:
Via CDN
Include the PassageJS library on your website as follows:
With Token Store
The base Passage constructor takes an optional config
parameter that allows you to define your own token store. If you would like to define custom methods for where to get, set, or clear auth related tokens you should use this pattern. See the Token Store Reference for more details.
References
Authentication ReferenceUser ReferenceSession ReferencePassageError ClassLast updated