Skip to content

Latest commit

 

History

History
65 lines (51 loc) · 1.12 KB

README.md

File metadata and controls

65 lines (51 loc) · 1.12 KB

AthenaSDK-JS

JavaScript SDK for Athena2.

Installation

npm i @atatctech/athena-sdk

Usage

const instance = useAthena();
test(instance,
    () => {
    console.log("online");
}, () => {
    console.log("unavailable");
}, undefined, () => {
    console.log("offline");
});

Create an Instance

const baseUrl = "http://localhost";
const port = 8080;

const instance = useAthena(baseUrl, port);

baseUrl refers to the backend server address. In this case, it is set to "http://localhost" instead of "https://athena2.atatctech.com" by default.

port specifies the port that the server listens.

The following example is equivalent to the one above.

const instance = useAthena("http://localhost:8080");

APIs

  • test()
  • userExists()
  • signUpRequest()
  • signUp()
  • signIn()
  • directSignIn()
  • athenaAuthToken()
  • getUserByName()
  • getUserByUID()
  • getUsers()
  • getUsersByUIDs()
  • getUsersWith()
  • getUserByAAT()
  • setUser()
  • setName()
  • setEmailRequest()
  • setEmail()
  • setPasswordRequest()
  • setPassword()
  • revokeTokens()