@authsignal/browser
Version:
<img width="1070" alt="Authsignal" src="https://raw.githubusercontent.com/authsignal/authsignal-browser/main/.github/images/authsignal.png">
30 lines (29 loc) • 997 B
TypeScript
import { AuthenticationResponseJSON, RegistrationResponseJSON, PublicKeyCredentialHint } from "@simplewebauthn/browser";
import { AuthsignalResponse } from "./types";
import { SecurityKeyApiClient } from "./api/security-key-api-client";
type SecurityKeyOptions = {
baseUrl: string;
tenantId: string;
onTokenExpired?: () => void;
enableLogging: boolean;
};
type EnrollResponse = {
token?: string;
registrationResponse?: RegistrationResponseJSON;
};
type VerifyResponse = {
isVerified: boolean;
token?: string;
authenticationResponse?: AuthenticationResponseJSON;
};
export declare class SecurityKey {
api: SecurityKeyApiClient;
private cache;
private enableLogging;
constructor({ baseUrl, tenantId, onTokenExpired, enableLogging }: SecurityKeyOptions);
enroll({ hints }?: {
hints?: PublicKeyCredentialHint[];
}): Promise<AuthsignalResponse<EnrollResponse>>;
verify(): Promise<AuthsignalResponse<VerifyResponse>>;
}
export {};