using Supabase;

namespace TestingServerPartWabi.HelpsUserData
{
    public static class InicializeSupabase
    {
        public static async Task<Client> InitClient() 
        {
            EnvReader.Load("..\\..\\..\\HelpsData\\data.env");

            string url = Environment.GetEnvironmentVariable("SUPABASE_URL");
            string key = Environment.GetEnvironmentVariable("SUPABASE_KEY");

            SupabaseOptions options = new SupabaseOptions
            {
                AutoConnectRealtime = true
            };

            Client supabase = new Client(url, key, options);
            await supabase.InitializeAsync();

            return supabase;
        }
    }
}
