Deck Docs

Quick start

Embed FeedbackDialog and ThumbsFeedback in a React app.

Quick start

Wrap your product UI in DeckProvider, then mount built-in widgets or your own form.

import { useState } from "react";
import {
  DeckProvider,
  FeedbackDialog,
  ThumbsFeedback,
} from "@deck-io/feedback";

function App() {
  return (
    <DeckProvider
      publishableKey={process.env.NEXT_PUBLIC_DECK_PUBLISHABLE_KEY!}
      user={{
        id: currentUser.id,
        email: currentUser.email,
        name: currentUser.name,
      }}
    >
      <ProductUi />
    </DeckProvider>
  );
}

function ProductUi() {
  const [open, setOpen] = useState(false);

  return (
    <>
      {/* You own the trigger button */}
      <button type="button" onClick={() => setOpen(true)}>
        Share feedback
      </button>

      <FeedbackDialog
        widgetId="wgt_your_widget_id"
        open={open}
        onOpenChange={setOpen}
        context={{ surface: "settings" }}
      />

      {/* Built-in thumbs; opens the dialog with sentiment pre-set */}
      <ThumbsFeedback
        widgetId="wgt_your_widget_id"
        context={{ messageId: "msg_123" }}
      />
    </>
  );
}

Replace:

  • wgt_your_widget_id with the ID from Manage → Widgets
  • currentUser.* with your authenticated user fields
  • NEXT_PUBLIC_DECK_PUBLISHABLE_KEY with your env name if needed

Minimal checklist

  • @deck-io/feedback installed
  • DeckProvider near the root of the feature (or app)
  • user.id is a stable product user id
  • widgetId matches a widget in the same org as the publishable key
  • Publishable key is a pk_… value (never dk_…)

Server-side (optional)

To submit from Route Handlers, Server Actions, or workers without React, use the server entry instead of (or in addition to) the UI above:

import { createDeckFeedbackClient } from "@deck-io/feedback/server";

const deck = createDeckFeedbackClient({
  publishableKey: process.env.DECK_PUBLISHABLE_KEY!,
});

await deck.submit({
  user: { id: session.userId, email: session.email },
  submission: {
    widgetId: "wgt_your_widget_id",
    sentiment: "negative",
    message: "Checkout failed after payment",
  },
});

See Server-side submit.

What to explore next

GoalGuide
All provider propsDeckProvider
Dialog and thumbs propsComponents
Custom UI onlyHeadless
Node / Next.js serverServer-side
Contact matchingIdentity and context