Secure crypto wallet

On the proposed tab shows you how to integrate auth by solving supabase baas to help your users reliably bind their wallets in their accounts web-based crypto wallet supabase. Therefore, you still have no opportunity to force users to enter User-friendly wallet interface the electronic account except with their wallets - at the same time you have the opportunity to connect wallets with previously existing supabase auth accounts, allowing you to act with your users in the chain.

To combine with the password for the integration of auth supabase, which we will implement in the effectiveness of the leadership, you can try the next github repository or clone it through the command below:

Thirdweb -auth -supabase

Before starting integration, you need to establish a fresh supabase project. You have the opportunity to order this by going to the supabase toolbar, creating an account if it is not available in the house, and after clicking the key to establish a fresh project. Settings of the supabase authentication supplier for russian visitors to open the system. They will become accounts, and with them we associate the addresses of the client. In such a guide, we are going to use the google authentication supplier, which you will get the opportunity to learn how to configure through the documentation of supabase google auth - however, you have the opportunity to put any of the other authentication manufacturers supported by supabase.

@>

, Take into account that the google authentication settings you need to organize a fresh project with oauth included in the gloomy console of google , and at the end add the google oauth accounting data to the high -quality supabase project.

> settings

, You barely created the supabase application and the authentication google tuning, you can better order autr integration into your application.

Try to start with this that let's create a cool next.Js project with thirdweb settings:

From the created project we need to put @thirdweb-dev/auth and @superbase/supabase- js packages:

- Npm - yarn - pnpm supabase settings

On the next the stage will be necessary for you to configure your own version for contact with the supabase project, which you are setting up. Choose on our page the settings of a particular case supabase:

Create the last list with the name lib and create two auxiliary scenarios to initialize supabase through a browser and server:

Lib createsupabase.Ts lib/createesupabaseadmin.Ts in the new millennium there is an easy method to get an approach to supabase auth and database in wednesdays as clients and also in the wednesday of the server!

Auth

Finally, the auth thirdweb auth settings we need to add a variable of the environment. It is focused on the prevention of phishing attacks - and, as usual, is put in the domain of the final product, like example.Com. You can get more about this fact in the thirdweb auth diploma.

Sign users

Today, when we are the mood of the supplier, we are able to configure the initial stream so that visitors have the opportunity to enter the network using supabase authentication. In this case, we will use the supabase.Signinwithoauth function with the seller google, because we set up this supplier on the supabase toolbar.

Receiving user files on the client side

, After users are in practice, we will want to decide that the wallpaper almost successfully went to the pipeline. In order to hand over the above our experts, we will use supabase.Auth.Getuser and supabase.Auth.Getsession functions to track the registered user in the scheme of the user authentication. To facilitate the contact of the wallets with accounts

After the user entrance, we strive to make such a way to bind our proven address of the supabase accounting record. We are able to create this by creating a new destination api, which checks the address of the visitors' wallet on the customer’s side, and then updates their accounting on supabase.

We are ready to make this viewing using the following code: after we fulfill the necessary, we are able to update the recording of the user information base by receiving the identifier from the client side access_token function, and at the end using the supabase.Adh.Admin.Updateuserbyid function to update the user metadata through the address of the wallet.

Binding the addresses of the wallet with accounts

Finally, the fact that you are a notification about a new wallet, sending it to the backend, and then bind the address of visitors from supabase accounting record.

With us, the masters are put into the useauth hook in order to achieve the function of thirdwauth.Login and order the user to sign the opening message to the network. At the end, our company publishes this useful load together with the current session of visitors with the end point/api/link, which we created to finish the connect with the address of the user's wallet.