Published On: January 26th, 2023Categories: AI News

Supabase is a great tool. But currently lacks the ability to natively use a Web3 Provider to authenticate. This guide aims to provide a walkthrough so you’ll be able to issue JSON web tokens to users who sign-in with their Ethereum Wallet.



What you’ll need:

  1. Supabase account

    1. JWT Key and Service Key
  2. Supabase public.users table
  3. A Client able to interact with Wallet Provider
    1. ethers.js and MetaMask
  4. Serverless Function Endpoints:

      /api/nonce
      /api/login
      /api/write
    

This walkthrough assumes your user has already connected their wallet. If you need help with that, check out the ethers.js documentation.

So, once they’ve connected, the first thing we’ll do behind the scenes in our client app code is make a POST request to the /api/nonce endpoint. In it, we’ll include the just-connected wallet address.



Supabase public.users Table

Before we can get into the code, we’ll need to set up a new table in our Supabase project. It’s…

Source link

Leave A Comment