Skip to content

eff3ct0/supabase-auth-scala

Repository files navigation

Supabase Auth

Release codecov License: MIT

Supabase Auth is a Scala library for interacting with the Supabase Auth API.

This Scala client follows the ideas of the official client supabase/auth-py

Getting Started

To get started, you'll need to create a Supabase account and obtain an API key. You can sign up for a free Supabase account here.

Once you have your API key, you can use the Supabase Auth library to interact with the Supabase Auth API. Here's an example of how to create a user:

Run Example: Sign Up with Email and Password

import cats.effect._
import com.eff3ct.supabase.auth.api._
import org.http4s.client._
import org.http4s.ember.client._
import org.http4s.implicits._

implicit val client: Resource[IO, Client[IO]] =
  EmberClientBuilder.default[IO].build

for {
  api <- SupabaseAuthAPI.create[IO](uri"https://your-supabase-url.supabase.co/auth/v1", "your-supabase-api-key")
  user <- api.signUpWithEmail("user@example.com", "password")
} yield user

Unsafe Run Example: Sign Up with Email and Password

import cats.effect._
import cats.effect.unsafe.implicits.global
import com.eff3ct.supabase.auth.api._
import org.http4s.ember.client._
import org.http4s.implicits._

implicit val client: ClientR[IO] = EmberClientBuilder.default[IO].build
implicit val api: SupabaseAuthAPI[IO] =
  SupabaseAuthAPI.create[IO](uri"https://your-supabase-url.supabase.co/auth/v1", "your-supabase-api-key")
    .unsafeRunSync()

SupabaseAuthAPI[IO].signUpWithEmail("user@example.com", "password").unsafeRunSync()

Contributing

Contributions are welcome! Please see the contributing guidelines for more information.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

About

Scala library for interacting with the Supabase Auth API

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages