Fubinator / gotrue-rs

GoTrue implementation in rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gotrue-rs

Rust Crate License: MIT

This is a GoTrue client implementation in rust. The library is currently under development. Most of the features are already built in, but there are still some changes to be made and everything still needs to be documented.

Usage

Add the following line to your Cargo.toml:

go_true = "0.1.1"

Examples

To create an account, create a new client and execute the sign_up function with email and password:

use go_true::{Client, EmailOrPhone};

#[tokio::main]
async fn main() {
    let mut client = Client::new("http://localhost:9998");

    let email = "email@example.com".to_string();
    let password = "Abcd1234!";

    let session = client.sign_up(EmailOrPhone::Email(email), password).await;

    println!("{:?}", session);
}

For more information, check out the API docs!

Testing

The first thing to do is to start the supabase server in docker:

cd infra
docker compose up

Once the server has been started, the tests can be run:

cargo test --tests

Contributing

Contributions, issues and feature requests are welcome. Feel free to check out the issues page if you want to contribute.

About

GoTrue implementation in rust

License:MIT License


Languages

Language:Rust 93.8%Language:PLpgSQL 6.2%