@slashid/react
Version:
React SDK for the /id platform
71 lines • 2.4 kB
TypeScript
import { KYC, KYCStatus } from "@slashid/slashid";
import { DarkThemeColors, Theme } from "../mobile-upload";
export declare class InvalidStateError extends Error {
constructor(flowId: string, invalidStatus: KYCStatus);
}
type CommonProps = {
/** The authenticated instance of the KYC SDK */
kyc: KYC;
/** Enable the live photo step, default `true` */
includeLivePhoto?: boolean;
/**
* Callback invoked when the last step is completed.
* The last step (document or live photo) depends on the `includeLivePhoto` value.
*/
onComplete?: () => void;
/** Object to override the default UI theme. */
theme?: Theme;
/** Object to override the default dark theme colors */
darkThemeColors?: DarkThemeColors;
/** Callback to render a custom logo. Returns `null` to remove the default logo. */
logo?: () => JSX.Element | null;
};
type FullModeProps = CommonProps & {
/**
* The flow type: `full` (user starts from a mobile device)
* or `hybrid` (user starts on desktop and delegates the uploading part to a separate mobile device).
*/
mode: "full";
/** The flow UUID, required only in `full` mode. */
flowId: string;
};
type HybridModeProps = CommonProps & {
/**
* The flow type: `full` (user starts from a mobile device)
* or `hybrid` (user starts on desktop and delegates the uploading part to a separate mobile device).
*/
mode: "hybrid";
};
type Props = FullModeProps | HybridModeProps;
/**
* The component can be used either in a `full` mobile flow
* (i.e. one that the user starts from a mobile device) or in a `hybrid` one
* (i.e. one that starts on desktop and delegates the uploading part to a separate mobile device).
*
* The Mobile flow component comes with a built-in UI theme that can be overridden in two ways:
* using the dedicated React props (`theme` and `darkThemeColors`) or via CSS variables ovverride.
*
* @example Hybrid Flow
* ```
* <MobileFlow
* mode="hybrid"
* kyc={kyc}
* />;
* ```
*
* @example Full Flow
* ```
* <MobileFlow
* mode="full"
* flowId={flowId}
* kyc={kyc}
* onComplete={() => {
// live photo step is completed, change your application state
* }}
* />;
* ```
*
*/
export declare const MobileFlow: (props: Props) => import("react/jsx-runtime").JSX.Element;
export {};
//# sourceMappingURL=mobile-flow.d.ts.map