UNPKG

@authsignal/node

Version:

<img width="1070" alt="Authsignal" src="https://raw.githubusercontent.com/authsignal/authsignal-node/main/.github/images/authsignal.png">

42 lines (41 loc) 1.17 kB
import { AuthsignalConstructor } from "./types"; export declare class CallConnect { apiSecretKey: string; apiUrl: string; constructor({ apiSecretKey, apiUrl, retries }: AuthsignalConstructor); startCall(request: StartCallRequest): Promise<StartCallResponse>; finishCall(request: FinishCallRequest): Promise<FinishCallResponse>; private getRequestConfig; } export type StartCallRequest = { referenceId: string; phoneNumber: string; userId?: string; username?: string; channel?: CallConnectMessageChannel; email?: string; locale?: string; }; export type StartCallResponse = { messageId?: string; status?: string; error?: string; channel?: CallConnectMessageChannel; }; export declare enum CallConnectMessageChannel { "WHATSAPP" = "WHATSAPP", "SMS" = "SMS" } export type FinishCallRequest = { referenceId: string; state: CallState; userId?: string; payload?: Record<string, unknown>; }; export type FinishCallResponse = { success: boolean; }; export declare enum CallState { "CHALLENGE_SUCCEEDED" = "CHALLENGE_SUCCEEDED", "CHALLENGE_FAILED" = "CHALLENGE_FAILED" }