@authsignal/browser
Version:
**[Authsignal](https://www.authsignal.com) provides passwordless step up authentication (Multi-factor Authentication - MFA) that can be placed anywhere within your application. Authsignal also provides a no-code fraud risk rules engine to manage when step
52 lines (51 loc) • 1.69 kB
TypeScript
import { PasskeyApiClient } from "./api/passkey-api-client";
import { AuthenticationResponseJSON, RegistrationResponseJSON, AuthenticatorAttachment } from "@simplewebauthn/types";
import { AuthsignalResponse } from "./types";
import { Authenticator } from "./api/types/shared";
type PasskeyOptions = {
baseUrl: string;
tenantId: string;
anonymousId: string;
onTokenExpired?: () => void;
};
type SignUpParams = {
token?: string;
username?: string;
displayName?: string;
authenticatorAttachment?: AuthenticatorAttachment | null;
useAutoRegister?: boolean;
};
type SignUpResponse = {
token?: string;
userAuthenticator?: Authenticator;
registrationResponse?: RegistrationResponseJSON;
};
type SignInParams = {
autofill?: boolean;
action?: string;
token?: string;
onVerificationStarted?: () => unknown;
};
type SignInResponse = {
isVerified: boolean;
token?: string;
userId?: string;
userAuthenticatorId?: string;
username?: string;
displayName?: string;
authenticationResponse?: AuthenticationResponseJSON;
};
export declare class Passkey {
api: PasskeyApiClient;
private passkeyLocalStorageKey;
private anonymousId;
private cache;
constructor({ baseUrl, tenantId, anonymousId, onTokenExpired }: PasskeyOptions);
signUp({ username, displayName, token, authenticatorAttachment, useAutoRegister, }: SignUpParams): Promise<AuthsignalResponse<SignUpResponse>>;
signIn(params?: SignInParams): Promise<AuthsignalResponse<SignInResponse>>;
isAvailableOnDevice({ userId }: {
userId: string;
}): Promise<boolean>;
private storeCredentialAgainstDevice;
}
export {};