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

    Class FeedbackClient

    Primary API client for interacting with CupThread backend services.

    The FeedbackClient manages network transport, serialization, user authentication tokens, error mapping, and platform targeting across all CupThread API surfaces.

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

    const client = new FeedbackClient({
    baseUrl: 'https://api.cupthread.com',
    appKey: 'app_live_sample123',
    defaultPlatform: 'ios',
    });

    // Submit feedback draft
    const result = await client.submit({
    title: 'Crash on launch in offline mode',
    description: 'App freezes on splash screen when cellular data is disabled.',
    });
    console.log(`Feedback submitted: ${result.submissionId}`);
    Index

    Resolved client configuration.

    • Retrieves published changelog entries and release notes sorted by publication date descending.

      Parameters

      Returns Promise<ChangelogEntry[]>

      Chronological list of release notes.

      const entries = await client.fetchChangelog();
      console.log(`Latest release: ${entries[0]?.title}`);
    • Retrieves all Kanban roadmap columns configured for the application, sorted by position.

      Parameters

      Returns Promise<BoardColumn[]>

      List of active roadmap columns in display order.

      const columns = await client.fetchColumns();
      columns.forEach(c => console.log(`${c.name} (position: ${c.position})`));
    • Retrieves all discussion comments for a feature request.

      Parameters

      • featureRequestId: string

        ID of the feature request.

      • Optionaloptions: RequestOptions | AbortSignal

      Returns Promise<FeatureRequestComment[]>

      List of discussion comments.

      const comments = await client.fetchComments('fr_123');
      console.log(`Loaded ${comments.length} comments.`);
    • Fetches paginated feature requests with optional milestone filtering and keyword search.

      Parameters

      • options: {
            limit?: number;
            offset?: number;
            query?: string;
            signal?: AbortSignal;
            timeoutMs?: number;
            userToken: string;
            versionId?: string;
        }

        Query parameters including userToken, limit, offset, versionId, and query.

        • Optionallimit?: number

          Maximum number of items to return per page (default: 50).

        • Optionaloffset?: number

          Page offset index (default: 0).

        • Optionalquery?: string

          Optional search query string.

        • Optionalsignal?: AbortSignal

          Optional abort signal to cancel the request.

        • OptionaltimeoutMs?: number

          Optional timeout in milliseconds for this request.

        • userToken: string

          Unique user token to evaluate hasVoted and isOwnRequest states.

        • OptionalversionId?: string

          Optional version ID filter.

      Returns Promise<ListFeatureRequestsResult>

      Paginated list of feature request items.

      const result = await client.fetchFeatureRequests({
      userToken: 'usr_token_abc',
      query: 'widgets',
      limit: 20,
      });
      console.log(`Found ${result.total} matching requests.`);
    • Retrieves the public developer profile, authored applications, and recent comment history.

      Parameters

      • userId: string

        Target user or developer identifier.

      • Optionaloptions: RequestOptions | AbortSignal

      Returns Promise<PublicUserProfileResult>

      Public profile details.

      const profile = await client.fetchUserProfile('usr_42');
      console.log(`Developer: ${profile.profile.displayName}`);
    • Retrieves all release version milestones for the application, sorted by position.

      Parameters

      Returns Promise<AppVersion[]>

      Array of version milestones.

      const versions = await client.fetchVersions();
      const shipped = versions.filter(v => v.released);
    • Posts a new discussion comment or reply on a feature request.

      Parameters

      • featureRequestId: string

        ID of the target feature request.

      • draft: CommentDraft

        Comment message content, author info, and optional reply pointers.

      • userToken: string

        User token of the commenter.

      • Optionaloptions: RequestOptions | AbortSignal

      Returns Promise<FeatureRequestComment>

      The created comment record.

      const comment = await client.postComment('fr_123', {
      body: 'We are targeting release in version 2.2!',
      authorName: 'Alex',
      }, userToken);
    • Evaluates app configuration and fetches entries for the What's-New modal sheet.

      Parameters

      Returns Promise<
          | {
              appearance: SdkAppearance;
              entries: ChangelogEntry[];
              latestKey: string;
          }
          | null,
      >

      Overlay payload or null if changelog feature is disabled, empty, or already seen.

      const overlayData = await client.prepareChangelogOverlay({ onlyIfUnseen: true });
      if (overlayData) {
      console.log(`Ready to show ${overlayData.entries.length} release highlights.`);
      }
    • Submits a user feedback draft, bug report, or feature inquiry.

      Parameters

      • draft: FeedbackDraft

        The feedback payload including title, description, and optional attachments.

      • OptionaluserToken: string

        Optional persistent anonymous or authenticated user token.

      • Optionaloptions: RequestOptions | AbortSignal

      Returns Promise<FeedbackSubmissionResult>

      A promise resolving to the submission result metadata.

      UnexpectedStatusException If the server returns a non-2xx status code.

      InvalidResponseException If a network failure occurs or JSON parsing fails.

      const result = await client.submit({
      title: 'Dark mode contrast issue',
      description: 'Secondary text on settings screen is hard to read in dark mode.',
      reporterEmail: 'user@example.com',
      });
    • Subscribes an email address to future changelog and release note announcements.

      Parameters

      • email: string

        Target email address to subscribe.

      • userToken: string

        Current user token.

      • Optionaloptions: RequestOptions | AbortSignal

      Returns Promise<ChangelogSubscriptionResult>

      Subscription status confirmation.

      const sub = await client.subscribeToChangelog('user@example.com', userToken);
      if (sub.subscribed) {
      console.log('Successfully subscribed to release notes.');
      }
    • Toggles an upvote on a specified feature request for the given user token.

      Parameters

      • featureRequestId: string

        ID of the target feature request.

      • userToken: string

        User token performing the vote.

      • Optionaloptions: RequestOptions | AbortSignal

      Returns Promise<VoteResult>

      Updated vote status and total vote count.

      const vote = await client.toggleVote('fr_123', userToken);
      console.log(`Voted: ${vote.voted}, New count: ${vote.voteCount}`);
    • Reports customer tier, subscription plan, or revenue metrics for a user token.

      Parameters

      • options: {
            currency?: string;
            isPaying?: boolean;
            mrr?: number;
            plan?: string;
            signal?: AbortSignal;
            timeoutMs?: number;
            userToken: string;
        }

        User attributes including subscription status, plan name, and MRR.

      Returns Promise<UserAttributesUpdateResult>

      Update confirmation.

      await client.updateUserAttributes({
      userToken: 'usr_token_abc',
      isPaying: true,
      plan: 'Pro Annual',
      mrr: 29.99,
      currency: 'USD',
      });