Client Side Enablement
Last updated
Last updated
While Passport is the custodial wallet, all operations are initiated by the end user on the client browser or app. Therefore, client-side JavaScript library and iOS/Android library are available to handle login confirmation as well as ensure any action or performed by an authenticated user.
For this version of the documentation, we will focus on web integration using JavaScript libraries. Credenza Passport allows for client-side user authentication as well as the ability currently access the Blockchain through a custodial wallet.
Embedding Passport on a website is done through a simple set of JavaScript includes as well as an instantiation of the Passport object:
NOTE: Passport version 5.0 and above requires Ethers v6. All earlier versions require Ethers v5. If you are having issues, confirm that the versions match. See the for additional information. Passport 8 eliminates the need for the Magic library. These external libraries, not affiliated with Credenza, not only facilitate the integration of Passport but also empower clients to leverage various advanced blockchain functionalities. By leveraging these libraries, we can instantiate a Passport object in JavaScript, exposing methods, properties, and events for accessing the blockchain and smart contracts.
Creating the Passport object is straightforward; we invoke the constructor with an optional set of parameters, defining the preferred blockchain and specifying crucial elements of the Presence visual components. The configuration variables will be elaborated in the Appendix, which has been significantly enriched in Passport 8. Below illustrates the breadth of implementing a Passport configuration.
Upon instantiating the Passport Object, you must invoke await passport.init()
for Passport to initialize. Once this step is completed, you gain programmatic access to all its features. The primary decision to be made is whether to utilize Credenza Presence, a library of UI elements designed to manage login and account access, or to craft custom elements using the Passport API. While we assume that Presence will be utilized, we acknowledge that some clients may opt to develop their own elements.
Numerous options are available, with most having default settings that can be overridden by configuration variables. Detailed information about these configuration options can be found in the .