🚀
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
  • Initialize Protico API
  • Get your users' access token
  • Revoke access on logout
  1. SDK

Use Protico APIs

To maintain Protico's efficiency without sacrificing its decentralized spirit, the SDK uses a hybrid method that incorporates both centralized and decentralized storage technologies. As decentralized data storage technologies continue to improve, we will integrate more of them into our infrastructure.

To use our APIs you'll need to get a Protico API Key!

Initialize Protico API

const proticoAPI = new ProticoAPI(API_KEY);

Get your users' access token

Use your Web3 ProvidersproticoAuth object to obtain your users' access token, and pass it to the ProticoAPI instance. This will manage your users authentication on our backend.

try {
    ...
    const authToken = proticoAuth.getWeb3AuthToken();
    proticoAPI.setAuthToken(authToken);
}
...

Revoke access on logout

When the user logout, revoke the authToken as follow:

 proticoAPI.clearAuthToken();
PreviousContactsNextSettings

Last updated 1 year ago