go-auth-client
v1.0.16
Published
Javascript client library for github.com/overlorddamygod/go-auth
Downloads
39
Readme
go-auth-client
Javascript client library for Go-auth
Installation
Using npm:
$ npm i go-auth-client
Usage
import auth from "go-auth-client"
const client = auth.createClient( GO_AUTH_SERVER_URL )
// User data can be accessed from client.user if logged in
How to use
Signing Up
const {data, error} = await client.signUp("email", "username", "password")
Signing In
// Sign in with Email and Password
const {data, error} = await client.signInWithEmail("email", "password")
// Sign in with MagicLink
const {data, error} = await client.signInWithMagicLink("email")
// Sign in with oauth provider
// Supported providers : github
client.signInWithProvider("github")
SignOut
const {data, error} = await client.signOut()
Auth Change Listener
client.onAuthChanged((user) => {
console.log(user)
})