@triagly/sdk
Version:
JavaScript SDK for Triagly - Turn user feedback into GitHub issues instantly
64 lines • 1.93 kB
TypeScript
export interface TriaglyConfig {
publishableKey: string;
getToken?: () => Promise<string>;
apiUrl?: string;
turnstileSiteKey?: string;
theme?: 'light' | 'dark' | 'auto';
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | 'edge-bottom-right' | 'edge-bottom-left' | 'edge-top-right' | 'edge-top-left' | 'edge-right' | 'edge-left' | 'edge-top' | 'edge-bottom';
buttonShape?: 'rounded' | 'circular' | 'square' | 'pill' | 'expandable';
orientation?: 'horizontal' | 'vertical';
offsetX?: string;
offsetY?: string;
customStyles?: Partial<CSSStyleDeclaration>;
buttonText?: string;
placeholderText?: string;
successMessage?: string;
errorMessage?: string;
onSuccess?: (feedbackId: string) => void;
onError?: (error: Error) => void;
onOpen?: () => void;
onClose?: () => void;
onCancel?: () => void;
onDismiss?: () => void;
onOverlayClick?: () => void;
metadata?: Record<string, any>;
captureConsole?: boolean;
consoleLogLimit?: number;
consoleLogLevels?: ('error' | 'warn' | 'log')[];
/** @deprecated Use publishableKey instead */
projectId?: string;
}
export interface ConsoleLog {
level: 'error' | 'warn' | 'log';
message: string;
timestamp: string;
stack?: string;
}
export interface FeedbackMetadata {
url: string;
browser?: string;
viewport?: string;
userAgent?: string;
timestamp?: string;
[key: string]: any;
}
export interface FeedbackData {
title?: string;
description: string;
tags?: string[];
screenshot?: string;
reporterEmail?: string;
reporterName?: string;
consoleLogs?: ConsoleLog[];
}
export interface FeedbackResponse {
id: string;
status: string;
createdAt: string;
}
export interface SessionResponse {
sessionId: string;
projectId: string;
expiresAt: string;
}
//# sourceMappingURL=types.d.ts.map