1.0.12 • Published 1 year ago

@emcecosystem/emchub-auth-client v1.0.12

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

@emcecosystem/auth-client

INSTALL

npm install --save @emcecosystem/auth-client

Example

import { instance as authClient } from "@emcecosystem/auth-client";
import type { SignInOptions, Message } from "@emcecosystem/auth-client";

type SignInSuccessMessage =
  | Message
  | {
      type: string;
      data: {
        _result: number;
        _desc: string;
        _sid?: string;
        user?: SignInUser;
      };
    };

type SignInUser = {
  id: number;
  nickname: string;
  avatar: string;
};

function onPressSignIn() {
  const options: SignInOptions = {
    provider: "https://emchub.ai/",
    windowOpenerFeatures: "popup,width=480,height=720",
    onSuccess: (message: SignInSuccessMessage) => {
      console.info(message.data);
    },
    onError: (error: string) => {
      console.info(error);
    },
  };
  authClient.signIn(options);
}
1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago