CupThread React Native & Expo SDK - v0.1.0
    Preparing search index...

    Interface FeedbackClientConfig

    Configuration parameters required to instantiate a FeedbackClient.

    import { FeedbackClientConfig } from '@cupthread/react-native';

    const config: FeedbackClientConfig = {
    baseUrl: 'https://api.cupthread.com',
    appKey: 'app_live_abc123',
    defaultPlatform: 'ios',
    };
    interface FeedbackClientConfig {
        appKey: string;
        baseUrl: string;
        defaultPlatform?: FeedbackPlatform;
        timeoutMs?: number;
        tokenTransport?: "query" | "header" | "both";
        turnstileTokenProvider?: () => | string
        | Promise<string | undefined>
        | undefined;
        uploadTimeoutMs?: number;
    }
    Index
    appKey: string

    Unique application key generated in the CupThread Developer Console. Typically starts with the "app_" prefix.

    baseUrl: string

    Root API URL of the CupThread backend instance (e.g., "https://api.cupthread.com"). Trailing slashes are automatically normalized and stripped.

    defaultPlatform?: FeedbackPlatform

    Default platform reported on feedback submissions and requests when not explicitly overridden by the caller.

    Note: Platform validation against the application's configured allowlist (PublicAppConfig.allowedPlatforms) is enforced at the composer layer (such as FeedbackComposer) via resolveAllowedPlatform. Direct calls to client.submit forward the draft or client default platform directly to the intake endpoint.

    Auto-detected at runtime via React Native Platform.OS

    timeoutMs?: number

    Request timeout in milliseconds for API (JSON) operations. If elapsed before the request settles, a RequestTimeoutException is thrown.

    Attachment uploads use a separate budget; see FeedbackClientConfig.uploadTimeoutMs.

    15000 (15 seconds)
    
    tokenTransport?: "query" | "header" | "both"

    Strategy for transmitting the user identity token on GET /api/v1/feature-requests.

    • 'header' (default): Sends the token via the X-User-Token HTTP header only. Prevents token leakage into access logs, reverse proxies, and browser history (CWE-598).
    • 'both': Sends the token in both the X-User-Token header and the userToken query parameter. Provided for transition compatibility during backend deployments.
    • 'query': Sends the token via the userToken query parameter only (legacy behavior, deprecated).
    'header'
    
    turnstileTokenProvider?: () => string | Promise<string | undefined> | undefined

    Optional async provider resolving a Cloudflare Turnstile token for protected intake endpoints (POST /api/v1/feedback, POST /api/v1/feature-requests).

    The production CupThread API enforces human verification on intake and responds with HTTP 403 / TurnstileRequiredException when the submission carries no (or an invalid) turnstileToken. When this provider is configured, FeedbackClient.submit and FeedbackClient.submitFeatureRequest call it before every intake submission and attach the resolved token to the JSON body. A turnstileToken set directly on the draft always takes precedence. Synchronous return values are also accepted. Return undefined to omit the field (e.g. when the host knows the endpoint is exempt).

    uploadTimeoutMs?: number

    Completion budget in milliseconds for attachment uploads (FeedbackClient.uploadAttachment). Screenshots and diagnostic archives routinely need longer than the JSON request budget on mobile uplinks, so uploads default to a dedicated, larger value. A per-call timeoutMs override on uploadAttachment still takes precedence.

    60000 (60 seconds)