🚀
ProticoSDK
  • 👋Welcome to Protico
  • Overview
    • 💡What we do
    • ✨Our Features
  • SDK
    • 🛠️Getting started
    • 📝Web3 Providers
      • Use existing provider
      • Initialize ProticoAuthCore
        • MetaMask
        • WalletConnect
        • Web3Auth
      • Login
      • Full example
    • 🧑Interact with Ceramic
      • Setting up Ceramic
      • 👤Profile
      • 🤝Contacts
    • Use Protico APIs
      • ⚙️Settings
      • 📋Whiteboard
      • 🗒️Announcement
      • ▪️Blocklist
    • 🔑User Keys
      • Encryption / Decryption
    • Considerations
      • Protico API Key
      • Rate Limiting
Powered by GitBook
On this page
  1. SDK
  2. Web3 Providers

Full example

Here's a full example of what the initialization would look like, with the three different providers.

  const proticoAuth = new ProticoAuthCore({
        chainId: "0x1", 
        enableLogging: true, 
        adapterConfigs: {
          [SUPPORTED_ADAPTERS.METAMASK]: { enable: true }, 
          [SUPPORTED_ADAPTERS.WALLET_CONNECT_V2]: {
            enable: true,
            projectId: xxx, 
          },
          [SUPPORTED_ADAPTERS.OPENLOGIN]: {
            enable: true,
            adapterSettings: {
              clientId, 
              web3AuthNetwork, 
              uxMode: "popup", 
              loginConfig: { 
                google: {
                  name: "Protico",
                  verifier: "protico-google",
                  typeOfLogin: "google",
                  clientId: googleClientID
                },
              },
            },
          },
        },
      });
  
  try {    
    await proticoAuth.connectTo(SUPPORTED_ADAPTER_TYPE.METAMASK);
    const provider = proticoAuth.provider;
    ...
  } catch(e){
  ...
  }
PreviousLoginNextInteract with Ceramic

Last updated 1 year ago

📝