Passport SDK v8
  • Overview
  • Account Lifecycle
  • Integration
    • Client Side Enablement
    • Credenza Presence (Optional Visual Elements)
    • Account Provisioning (Sign-up)
      • New Authentication System
      • Existing Authentication System - New Customer
      • Existing Authentication System - Existing Customer
  • Passport Subsequent Logins
  • Post-Login Capabilities
    • Account Information Access
    • Blockchain Wallet Access
  • Smart Contract Interactions
    • Instantiating The Contract Object (Server-Side)
    • Instantiating The Contract Object (Client-side)
    • Calling Contracts
  • Monetary Transactions
  • Appendix I: Passport Configuration Options
    • Credenza Core Web SDK (Auth)
    • Ethers.js
    • Installation
    • Usage
    • Passport Instance Properties
    • Passport Static Properties
    • Modes
  • Appendix IA: Transaction UI v3.0 (now part of Passport)
    • Installation
    • Usage
    • Apple Pay
    • Google Pay
    • Methods
    • Events
  • Appendix II: MetaMembership Contract Access
  • Appendix III: Ledger Contract Access
  • Appendix IV: Decentralized Commerce Configuration
  • Appendix V: Migration From Previous Passports
Powered by GitBook
LogoLogo

©2023 Credenza. All rights reserved.

On this page
  1. Appendix I: Passport Configuration Options

Usage

import {Passport} from '@credenza-web3/passport'

or

const Passport = window.CredenzaPassport

const passport = new Passport({
  chainId: Passport.chains.POLYGON_MUMBAI,
  clientId: "СREDENZA OAUTH CLIENT ID",
  config: {
    buyTokens?: true
    auth?: {
      extendedRegistration: false,
      credentials?: false
      google?: true
      ticketmaster?: false
      passwordless?: false
      metamask?: true
    },
    nav?: {
      theme?: Passport.themes.BLACK,
      direction?: Passport.navDirections.BOTTOM,
    },
    email?: {
      templateId?: string // For custom email template usage
    },
    content?: {
      cloak?: boolean
      // depends on `cloak: true`
      payPerArticle?: [
        {
          nfts: [{address: 'contract-address-1', tokens:['token-id-1', 'token-id-2'], type: 'ERC1155' | 'ERC721'}],
          memberships: [{address: 'contract-address-1', owner: 'owner-address-1'}],
          uriMasks: ['part-of-the-article-uri'] // [''] for all uris
        }
      ],
      imageUrl?: 'https://yoursite.com/image.png', // Replaces default `Standford Socker` image
      signin: {
        title: "Your title!", // Replaces default ``
        description: "Your description.", // Replaces default ``
      },
      signup: {
        title: "Your title!", // Replaces default ``
        description: "Your description.", // Replaces default ``
      },
      logout: {
        title: "Your title!", // Replaces default ``
        description: "Your description!", // Replaces default ``
      },
      paymentResult?: {
        title?: "Your title!", // Replaces default `Success!`
        subtitle?: "Your subtitle!", // Replaces default `Your payment was successful!`
        description?: "Your description!", // Replaces default `Usually it takes us as many as a few minutes to deliver tokens to your account.`
      }
      progressVideos?: [{
        embedded: true,
        src: 'https://www.youtube.com/embed/tgbNymZ7vqY',
      }, {
        src: 'https://media.w3.org/2010/05/sintel/trailer.mp4'
      }]
    },
  },
})
await passport.init()

chainId: The universal blockchain identifier for each of our supported chains as well as theire testnet counterparts.

clientId: The ID issused by Credenza that gives you authority to implement Passprot as well as define available authentication options

buyTokens: Enable the purchased of stored value, whether it is Credenza's standard CRED token or another ERC20-compliant token.

auth: Specific auth services that are made available for login.

nav: Credenza Presence provides a persistent Nav Bar. This config variables allows you to determine its position and appearance.

email: While Credenza provides generic email templates, clients that request a special format can specify that here.

cloak: This variable allows the client to specify whether only logged in users can access this page.

payPerArticle: Allowing for site content to be restricted to members, token holders, or users with enough loyalty points. It's a form of Digital Rights Management (DRM).

imageUrl: A custom image for the login page if you want to brand it

signin: Customizable messaging on the sign in page.

signup: Customizable messaging when users sign out.

logout: Customizable messaging when users sign out.

paymentResult: Customizable messaging when users make a purchase.

progressVideos: When Credenza runs transactions, the systems asks the user to wait until the blockchain activity commits, which can take any where from 2 seconds to 20 seconds. Seems like a perfect time for a short commercial. This is where you can set the video for when users wait. This feature does allow the user to "skip" once the transaction is complete.

PreviousInstallationNextPassport Instance Properties

Last updated 1 year ago