MiteSDK

Feature Requests

Run a feature request board with voting, submissions, and a drop-in UI.

Mite gives you a feature request board your users can read, vote on, and submit to. Mount FeatureRequestsSheet for a complete UI, or use the hook and build your own.

Votes and submissions are tied to the SDK's identified or anonymous end user — you do not need to pass identifiers yourself.

Drop-in UI

FeatureRequestsSheet wraps any element and turns it into a trigger. Tapping it opens a sheet listing the board, with vote buttons and a compose form.

import { FeatureRequestsSheet } from '@usemite/sdk'

<FeatureRequestsSheet onSubmitted={id => console.log('Created', id)}>
  <Text>Request a feature</Text>
</FeatureRequestsSheet>
PropTypeDefaultDescription
childrenReactNodeElement used as the trigger
titlestring'Feature requests'Sheet heading
accentColorstring#0a7ea4Color for vote buttons and the submit action
onSubmitted(featureRequestId: string) => voidCalled after a successful submission

The board is fetched lazily — nothing is requested until the sheet is opened. Voting is optimistic: the count moves immediately and reverts if the request fails.

Using the hook

import { useFeatureRequests } from '@usemite/sdk'

const {
  featureRequests,
  votedFeatureRequestIds,
  loading,
  error,
  refetch,
  submitFeatureRequest,
  submitting,
  submitError,
  toggleVote,
  votingFeatureRequestIds,
} = useFeatureRequests({ enabled: true })

enabled defaults to false. Nothing is fetched until you pass enabled: true — useful for deferring the request until a sheet or screen opens, but surprising if you expect a fetch on mount.

Options

OptionTypeDefaultDescription
enabledbooleanfalseFetch the board and vote state on mount
voterEmailstringDeprecated. Look up votes by email instead of by end user

Return value

FieldTypeDescription
featureRequestsFeatureRequest[]The board
votedFeatureRequestIdsstring[]IDs the current user has voted for
loadingbooleanWhether the board is being fetched
errorError | nullFetch error
refetch() => Promise<void>Refetch the board and vote state
submitFeatureRequest(input: SubmitFeatureRequestInput) => Promise<CreateFeatureRequestResponse>Create a request, then refetch
submittingbooleanWhether a submission is in flight
submitErrorError | nullSubmission error
toggleVote(featureRequestId: string) => Promise<VoteFeatureRequestResponse>Toggle a vote, optimistically
votingFeatureRequestIdsstring[]IDs with a vote request in flight — use to disable buttons

refetch never rejects. submitFeatureRequest and toggleVote do reject, in addition to setting their error state, so you can react inline.

Submitting

await submitFeatureRequest({
  title: 'Offline mode',
  description: 'Let users browse cached content without a connection',
  author_name: 'Taylor',
  author_email: 'taylor@example.com',
})

Or directly on the instance:

await mite.createFeatureRequest({
  title: 'Offline mode',
  description: 'Let users browse cached content without a connection',
  author_email: 'taylor@example.com',
})

author_email is required. The team needs a way to follow up and notify the author of status changes. author_name is optional — requests without one are displayed as anonymous.

Emails are lowercased and trimmed before sending. title is trimmed; description defaults to an empty string.

Voting

toggleVote flips the current user's vote:

const { voted, voteCount } = await toggleVote('fr_123')

Or directly:

await mite.voteFeatureRequest({ feature_request_id: 'fr_123' })

The vote is attributed to the current anonymous or identified user automatically. Fetch existing votes with:

const votedIds = await mite.getFeatureRequestVotes()

voter_email on voteFeatureRequest, and voterEmail on the hook and getFeatureRequestVotes(), are deprecated. They exist only to keep older email-based votes working. New code should omit them and let the SDK use the end user identity. They are ignored entirely in anonymous-only mode.

Fetching the board directly

const requests = await mite.getFeatureRequests()

The FeatureRequest object

interface FeatureRequest {
  id: string
  title: string
  description: string
  authorName: string
  voteCount: number
  status: FeatureRequestStatus
  createdAt: number
}

Note the casing: responses use camelCase (authorName, voteCount), while request payloads use snake_case (author_name, author_email).

Status values

StatusDescription
OPENAccepting votes and feedback
IN_PROGRESSCurrently being worked on
COMPLETEDFeature has been shipped
CLOSEDNo longer planned

FeatureRequestsSheet renders these as "Open", "In progress", "Completed", and "Closed".

On this page