Install the React provider, open widget views from your components, and pass server-signed customer identity safely.
@gleanfeed/react wraps the browser widget with a provider and hook. Use it in React 18 or 19 apps, including Next.js App Router projects.
Install the packages
Install both the React wrapper and its widget dependency:
npm install @gleanfeed/react @gleanfeed/widget
Add the provider
Create a client component near the root of your app. The package can be imported during server rendering, but the provider initializes the widget after the browser mounts it.
"use client";import { GleanFeedProvider, type GleanFeedUser } from "@gleanfeed/react";import type { ReactNode } from "react";export function FeedbackProvider({ children, user,}: { children: ReactNode; user?: GleanFeedUser;}) { return ( <GleanFeedProvider workspace="acme" workspaceId="YOUR_WORKSPACE_ID" user={user} defaultView="feedback" > {children} </GleanFeedProvider> );}
The provider accepts the same configuration as init(). Unmounting it removes the launcher, iframe, event listeners, and notification polling. React Strict Mode remounts do not leave duplicate widget instances.
Open and close the widget
Call the hook from a client component below the provider:
You can also call open("feedback" | "roadmap" | "changelog") when a single component needs to choose the view dynamically.
Pass signed customer identity
Generate the signature on your server. Never import the widget secret into a client component or
expose it through a NEXT_PUBLIC_... environment variable.
Follow the identity signing contract, then pass only the signed GleanFeedUser object from your server component to FeedbackProvider. If the signed-in customer changes without remounting the provider, reidentify them from a client component:
"use client";import { useEffect } from "react";import { useGleanFeed, type GleanFeedUser } from "@gleanfeed/react";export function CustomerIdentity({ user }: { user: GleanFeedUser }) { const { identify } = useGleanFeed(); useEffect(() => { void identify(user); }, [identify, user]); return null;}
Prefer passing user to GleanFeedProvider; use identify() when your app changes customers while the provider stays mounted.
Compatibility
The wrapper supports React 18.2 and React 19 and depends on a compatible
@gleanfeed/widget. During 0.x, pin exact versions when upgrades require a
controlled test window. Review the full version and compatibility policy.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Glean Feed","description":"Learn how to collect feedback, publish roadmap updates, launch a public portal, and embed Glean Feed in your product.","colors":{"primary":"#1A1816","light":"#F6F6F5","dark":"#1A1816"},"logo":{"light":"https://mintcdn.com/gleanfeed/9Cksmp6iAukvIiii/brand/glean-lockup.svg?fit=max\u0026auto=format\u0026n=9Cksmp6iAukvIiii\u0026q=85\u0026s=de09e922b5d0a5f97d2a6a4945603fea","dark":"https://mintcdn.com/gleanfeed/9Cksmp6iAukvIiii/brand/glean-lockup-dark.svg?fit=max\u0026auto=format\u0026n=9Cksmp6iAukvIiii\u0026q=85\u0026s=1be992be3aa54fecd0438b453a1746d8","href":"https://gleanfeed.com"},"favicon":{"light":"https://mintcdn.com/gleanfeed/9Cksmp6iAukvIiii/brand/glean-mark.svg?fit=max\u0026auto=format\u0026n=9Cksmp6iAukvIiii\u0026q=85\u0026s=862024ec9ac2347df27e89e133d99059","dark":"https://mintcdn.com/gleanfeed/9Cksmp6iAukvIiii/brand/glean-mark-white.svg?fit=max\u0026auto=format\u0026n=9Cksmp6iAukvIiii\u0026q=85\u0026s=54948197c0db5e98a450464e53bd4c14"},"appearance":{"default":"system"},"background":{"color":{"light":"#FAFAF9","dark":"#100F0D"}},"navbar":{"links":[{"href":"https://gleanfeed.com","label":"Home"}],"primary":{"type":"button","label":"Open app","href":"https://app.gleanfeed.com"}},"search":{"prompt":"Search Glean Feed docs"},"seo":{"indexing":"navigable"},"fonts":{"family":"Geist"},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","grok","aistudio","mcp","add-mcp","cursor","vscode"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"gleanfeed","hasAudioNarration":false,"actualSubdomain":"gleanfeed","customDomains":["gleanfeed.com"],"gitSource":{"type":"github","owner":"mweisberg21","repo":"gleanfeed-app","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae95b0634ab80277e3e0971:success","clientVersion":"0.0.4377","searchFilterCounts":[{"language":"default","tag":"Developer guides","count":32},{"language":"default","tag":"Product guides","count":16},{"language":"default","tag":"API \u0026 MCP","count":8},{"language":"default","tag":"Start in your repository","count":7},{"language":"default","tag":"iOS SDK","count":7},{"language":"default","tag":"Embed Glean Feed","count":7},{"language":"default","tag":"Customize your portal","count":5},{"language":"default","tag":"Account and workspace","count":3},{"language":"default","tag":"Headless SDK","count":3},{"language":"default","tag":"Integrations","count":3}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"/docs","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":true},"customCss":[{"filePath":"custom.css","content":":root{--gf-bg: #fafaf9;--gf-surface: #ffffff;--gf-muted: #f6f6f5;--gf-border: #e8e6e2;--gf-ink: #1a1816;--gf-ink-muted: #605c56;--gf-link: #1a1816;--gf-active: color-mix(in srgb, var(--gf-muted), var(--gf-ink) 7%);--gf-code-bg: #100f0d;--gf-font-sans:\n \"Geist\", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;--gf-font-mono: \"Geist Mono\", \"SFMono-Regular\", Consolas, \"Liberation Mono\", Menlo, monospace}html.dark{--gf-bg: #100f0d;--gf-surface: #1a1816;--gf-muted: #1f1d1a;--gf-border: #2a2723;--gf-ink: #f6f6f5;--gf-ink-muted: #a3a09a;--gf-link: #f6f6f5;--gf-active: color-mix(in srgb, var(--gf-muted), var(--gf-ink) 7%);--gf-code-bg: #0b0a09}html,body,#background-color{background:var(--gf-bg)!important;color:var(--gf-ink);font-family:var(--gf-font-sans)}::selection{background:color-mix(in srgb, var(--gf-ink) 14%, transparent)}#navbar{border-bottom:1px solid var(--gf-border);background:color-mix(in srgb, var(--gf-bg) 92%, transparent);backdrop-filter:blur(16px) saturate(140%)}nav-logo img{height:24px;width:auto}#sidebar,#sidebar-content,#table-of-contents,#table-of-contents-content{background:var(--gf-bg)}#page-title,mdx-content h1,mdx-content h2,mdx-content h3,mdx-content h4{color:var(--gf-ink);font-family:var(--gf-font-sans);font-weight:600;letter-spacing:0}mdx-content p,mdx-content li,mdx-content td{color:var(--gf-ink-muted)}mdx-content strong,mdx-content th{color:var(--gf-ink)}mdx-content a,link{color:var(--gf-link);text-decoration-color:color-mix(in srgb, var(--gf-link) 38%, transparent);text-underline-offset:0.18em}mdx-content a:hover{text-decoration-color:var(--gf-link)}#search-bar-entry,#search-bar-entry-mobile,button,input,textarea,select{border-radius:8px}#search-bar-entry,#search-bar-entry-mobile{border:1px solid var(--gf-border);background:var(--gf-surface);color:var(--gf-ink-muted)}#topbar-cta-button{font-weight:500}a[href^=\"https://www.mintlify.com?utm_campaign=poweredBy\"]{color:var(--gf-ink-muted)!important}#sidebar-content :is(li[data-active],li[data-active-nav-item])>a,#sidebar-content a[aria-current=\"page\"],toc-item[data-active],toc-item[data-active-deepest]{background:var(--gf-active);border-radius:8px;color:var(--gf-ink);font-weight:500;text-shadow:none}icon,tab-icon{color:var(--gf-ink)}html.dark img[src$=\"/integrations/linear.svg\"]{content:url(\"/integrations/linear-dark.svg\")}html.dark img[src^=\"/icons/\"],html.dark img[src*=\"/icons/\"]{filter:brightness(0) invert(1)}card,callout,accordion,code-block{border:1px solid var(--gf-border);border-radius:8px;box-shadow:none}card{background:var(--gf-surface)}card:hover{border-color:color-mix(in srgb, var(--gf-ink) 30%, var(--gf-border))}callout,accordion{background:var(--gf-muted)}code-block,pre{background:var(--gf-code-bg)!important;font-family:var(--gf-font-mono)}mdx-content :not(pre)>code{border:1px solid var(--gf-border);border-radius:6px;background:var(--gf-muted);color:var(--gf-ink);font-family:var(--gf-font-mono)}mdx-content table{border-color:var(--gf-border)}mdx-content th{background:var(--gf-muted)}mdx-content tr{border-color:var(--gf-border)}"}]}
{"page":{"pagePath":"widget/react","slug":"/widget/react","pageMetadata":{"title":"Use the widget with React","description":"Install the React provider, open widget views from your components, and pass server-signed customer identity safely.","sidebarTitle":"React","icon":"/icons/filled/code.svg","href":"/widget/react"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Install the React provider, open widget views from your components, and pass server-signed customer identity safely.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[_jsx(_components.code,{children:`@gleanfeed/react`}),` wraps the browser widget with a provider and hook. Use it in React 18 or 19 apps, including Next.js App Router projects.`]}),`\n`,_jsx(Heading,{level:`2`,id:`install-the-packages`,children:`Install the packages`}),`\n`,_jsx(_components.p,{children:`Install both the React wrapper and its widget dependency:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` install`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @gleanfeed/react`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @gleanfeed/widget`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`add-the-provider`,children:`Add the provider`}),`\n`,_jsx(_components.p,{children:`Create a client component near the root of your app. The package can be imported during server rendering, but the provider initializes the widget after the browser mounts it.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`23`,language:`tsx`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`tsx`,children:_jsxs(_components.code,{language:`tsx`,numberOfLines:`23`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"use client\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`GleanFeedProvider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` GleanFeedUser`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@gleanfeed/react\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ReactNode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"react\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`export`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` FeedbackProvider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` children`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` user`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` children`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` ReactNode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` user`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?:`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` GleanFeedUser`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}) {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#4EC9B0`},children:`GleanFeedProvider`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` workspace`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"acme\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` workspaceId`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"YOUR_WORKSPACE_ID\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` user`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`user`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` defaultView`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"feedback\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` >`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` {`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`children`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#4EC9B0`},children:`GleanFeedProvider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The provider accepts the same configuration as `,_jsx(_components.a,{href:`/widget/configuration#configuration-options`,children:_jsx(_components.code,{children:`init()`})}),`. Unmounting it removes the launcher, iframe, event listeners, and notification polling. React Strict Mode remounts do not leave duplicate widget instances.`]}),`\n`,_jsx(Heading,{level:`2`,id:`open-and-close-the-widget`,children:`Open and close the widget`}),`\n`,_jsx(_components.p,{children:`Call the hook from a client component below the provider:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`24`,language:`tsx`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`tsx`,children:_jsxs(_components.code,{language:`tsx`,numberOfLines:`24`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"use client\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`useGleanFeed`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@gleanfeed/react\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`export`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` FeedbackControls`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`openFeedback`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`openRoadmap`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`openChangelog`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`close`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` useGleanFeed`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`nav`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` aria-label`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Product feedback\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`button`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"button\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` onClick`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`openFeedback`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Send feedback`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`button`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`button`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"button\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` onClick`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`openRoadmap`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Roadmap`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`button`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`button`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"button\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` onClick`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`openChangelog`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Updates`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`button`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`button`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"button\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` onClick`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`close`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Close`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`button`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`nav`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`You can also call `,_jsx(_components.code,{children:`open(\"feedback\" | \"roadmap\" | \"changelog\")`}),` when a single component needs to choose the view dynamically.`]}),`\n`,_jsx(Heading,{level:`2`,id:`pass-signed-customer-identity`,children:`Pass signed customer identity`}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Generate the signature on your server. Never import the widget secret into a client component or\nexpose it through a `,_jsx(_components.code,{children:`NEXT_PUBLIC_...`}),` environment variable.`]})}),`\n`,_jsxs(_components.p,{children:[`Follow the `,_jsx(_components.a,{href:`/widget/identity`,children:`identity signing contract`}),`, then pass only the signed `,_jsx(_components.code,{children:`GleanFeedUser`}),` object from your server component to `,_jsx(_components.code,{children:`FeedbackProvider`}),`. If the signed-in customer changes without remounting the provider, reidentify them from a client component:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`tsx`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`tsx`,children:_jsxs(_components.code,{language:`tsx`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"use client\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`useEffect`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"react\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`useGleanFeed`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` GleanFeedUser`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@gleanfeed/react\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`export`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` CustomerIdentity`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`user`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`user`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` GleanFeedUser`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`identify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` useGleanFeed`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` useEffect`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` void`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` identify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`user`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }, [`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`identify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`user`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Prefer passing `,_jsx(_components.code,{children:`user`}),` to `,_jsx(_components.code,{children:`GleanFeedProvider`}),`; use `,_jsx(_components.code,{children:`identify()`}),` when your app changes customers while the provider stays mounted.`]}),`\n`,_jsx(Heading,{level:`2`,id:`compatibility`,children:`Compatibility`}),`\n`,_jsxs(_components.p,{children:[`The wrapper supports React 18.2 and React 19 and depends on a compatible\n`,_jsx(_components.code,{children:`@gleanfeed/widget`}),`. During `,_jsx(_components.code,{children:`0.x`}),`, pin exact versions when upgrades require a\ncontrolled test window. Review the full `,_jsx(_components.a,{href:`/widget/versions`,children:`version and compatibility policy`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Use the widget with React","description":"Install the React provider, open widget views from your components, and pass server-signed customer identity safely.","sidebarTitle":"React","icon":"/icons/filled/code.svg","href":"/widget/react"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Install the packages","slug":"install-the-packages","depth":2,"children":[]},{"title":"Add the provider","slug":"add-the-provider","depth":2,"children":[]},{"title":"Open and close the widget","slug":"open-and-close-the-widget","depth":2,"children":[]},{"title":"Pass signed customer identity","slug":"pass-signed-customer-identity","depth":2,"children":[]},{"title":"Compatibility","slug":"compatibility","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/gleanfeed/77ef72ca4eb06d1a/accessibility.js"],"subdomain":"gleanfeed","siteName":"Glean Feed","title":"Use the widget with React - Glean Feed","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-14T12:38:36.517Z","originalFileLocation":"widget/react.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Install the React provider, open widget views from your components, and pass server-signed customer identity safely.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Glean Feed\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/gleanfeed/r2xFMCuqxaZbs1pW/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/gleanfeed/r2xFMCuqxaZbs1pW/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/gleanfeed/r2xFMCuqxaZbs1pW/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/gleanfeed/r2xFMCuqxaZbs1pW/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/gleanfeed/r2xFMCuqxaZbs1pW/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/gleanfeed/r2xFMCuqxaZbs1pW/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/gleanfeed/r2xFMCuqxaZbs1pW/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/gleanfeed/r2xFMCuqxaZbs1pW/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/gleanfeed/r2xFMCuqxaZbs1pW/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Use the widget with React - Glean Feed\">\u003cmeta data-mint-head property=\"og:description\" content=\"Install the React provider, open widget views from your components, and pass server-signed customer identity safely.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Glean Feed\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://gleanfeed.com/docs/widget/react\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://gleanfeed.mintlify.site/docs/_mintlify/api/og/v2?division=Embed+Glean+Feed\u0026amp;title=Use+the+widget+with+React\u0026amp;description=Install+the+React+provider%2C+open+widget+views+from+your+components%2C+and+pass+server-signed+customer+identity+safely.\u0026amp;theme=337f7cd54256ebd32b426179\u0026amp;signature=5ef7e860173ac62cd6b2b34465a33a03ffc2784d030b9249da4887970d2df334\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Use the widget with React - Glean Feed\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Install the React provider, open widget views from your components, and pass server-signed customer identity safely.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://gleanfeed.mintlify.site/docs/_mintlify/api/og/v2?division=Embed+Glean+Feed\u0026amp;title=Use+the+widget+with+React\u0026amp;description=Install+the+React+provider%2C+open+widget+views+from+your+components%2C+and+pass+server-signed+customer+identity+safely.\u0026amp;theme=337f7cd54256ebd32b426179\u0026amp;signature=5ef7e860173ac62cd6b2b34465a33a03ffc2784d030b9249da4887970d2df334\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/gleanfeed/r2xFMCuqxaZbs1pW/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Glean Feed\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#1A1816\">\u003clink data-mint-head rel=\"canonical\" href=\"https://gleanfeed.com/docs/widget/react\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/widget/react.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://gleanfeed.com/#organization\",\"name\":\"Glean Feed\",\"url\":\"https://gleanfeed.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/gleanfeed/9Cksmp6iAukvIiii/brand/glean-lockup.svg?fit=max\u0026auto=format\u0026n=9Cksmp6iAukvIiii\u0026q=85\u0026s=de09e922b5d0a5f97d2a6a4945603fea\"}},{\"@type\":\"WebSite\",\"@id\":\"https://gleanfeed.com/docs#website\",\"name\":\"Glean Feed\",\"url\":\"https://gleanfeed.com/docs\",\"publisher\":{\"@id\":\"https://gleanfeed.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://gleanfeed.com/docs/widget/react#webpage\",\"url\":\"https://gleanfeed.com/docs/widget/react\",\"name\":\"Use the widget with React\",\"description\":\"Install the React provider, open widget views from your components, and pass server-signed customer identity safely.\",\"dateModified\":\"2026-07-14T12:38:36.517Z\",\"isPartOf\":{\"@id\":\"https://gleanfeed.com/docs#website\"},\"breadcrumb\":{\"@id\":\"https://gleanfeed.com/docs/widget/react#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://gleanfeed.com/docs/widget/react#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Embed Glean Feed\",\"item\":\"https://gleanfeed.com/docs/widget/install\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Use the widget with React\",\"item\":\"https://gleanfeed.com/docs/widget/react\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://gleanfeed.com/docs/widget/react#article\",\"headline\":\"Use the widget with React\",\"name\":\"Use the widget with React\",\"description\":\"Install the React provider, open widget views from your components, and pass server-signed customer identity safely.\",\"url\":\"https://gleanfeed.com/docs/widget/react\",\"mainEntityOfPage\":{\"@id\":\"https://gleanfeed.com/docs/widget/react#webpage\"},\"dateModified\":\"2026-07-14T12:38:36.517Z\",\"publisher\":{\"@id\":\"https://gleanfeed.com/#organization\"},\"isPartOf\":{\"@id\":\"https://gleanfeed.com/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Glean Feed\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Glean Feed\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/widget/react.md","siteName":"Glean Feed","nav":{"global":null,"tabs":[{"tab":"Product guides","pages":[{"title":"Product guides","href":""}]},{"tab":"Developer guides","groups":[{"group":"Start in your repository","root":{"title":"Build with Glean Feed","sidebarTitle":"Choose an integration","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/code.svg","href":"/developers"},"pages":[{"title":"Glean Feed CLI","sidebarTitle":"CLI overview","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/code.svg","href":"/api/cli"},{"title":"CLI quickstart","sidebarTitle":"Five-minute quickstart","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/rocket.svg","href":"/api/cli-quickstart"},{"title":"CLI command reference","sidebarTitle":"Command reference","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/code.svg","href":"/api/cli-reference"},{"title":"CLI profiles and repository config","sidebarTitle":"Profiles and config","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/settings.svg","href":"/api/cli-profiles"},{"title":"Use the CLI with agents and CI","sidebarTitle":"Agents and CI","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/code.svg","href":"/api/cli-agents-ci"},{"title":"CLI security","sidebarTitle":"Security","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/key.svg","href":"/api/cli-security"},{"title":"Troubleshoot the CLI","sidebarTitle":"Troubleshooting","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/help.svg","href":"/api/cli-troubleshooting"}]},{"group":"API \u0026 MCP","pages":[{"title":"Make your first API request","sidebarTitle":"API quickstart","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/rocket.svg","href":"/api/overview"},{"title":"JavaScript SDK","sidebarTitle":"JavaScript SDK","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/code.svg","href":"/api/javascript-sdk"},{"title":"Authentication","sidebarTitle":"Authentication","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/key.svg","href":"/api/authentication"},{"title":"Scopes","sidebarTitle":"Scopes","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/key.svg","href":"/api/scopes"},{"title":"Endpoints","sidebarTitle":"Endpoints","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/code.svg","href":"/api/endpoints"},{"title":"Connect over MCP","sidebarTitle":"Connect over MCP","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/link.svg","href":"/api/mcp"},{"title":"Install agent skills","sidebarTitle":"Agent skills","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/code.svg","href":"/api/agent-skills"},{"title":"REST API examples","sidebarTitle":"Examples","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/code.svg","href":"/api/examples"}]},{"group":"Headless SDK","pages":[{"title":"Headless SDK overview","sidebarTitle":"Overview","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/code.svg","href":"/headless/overview"},{"title":"Capture feedback in your own UI","sidebarTitle":"Feedback quickstart","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/feedback.svg","href":"/headless/feedback"},{"title":"Render updates in your own UI","sidebarTitle":"Updates quickstart","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/changelog.svg","href":"/headless/changelog"}]},{"group":"Embed Glean Feed","pages":[{"title":"Install the widget","description":"Add a working Glean Feed launcher to your web app, then choose launcher or inline mode.","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/code.svg","href":"/widget/install"},{"title":"Use the widget with React","sidebarTitle":"React","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/code.svg","href":"/widget/react"},{"title":"Configure the widget","description":"Choose the widget mode, starting view, launcher appearance, and lifecycle methods.","sidebarTitle":"Configuration","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/sliders.svg","href":"/widget/configuration"},{"title":"Identify customers","sidebarTitle":"Identity","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/key.svg","href":"/widget/identity"},{"title":"Widget notifications","sidebarTitle":"Notifications","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/bell.svg","href":"/widget/notifications"},{"title":"Web package compatibility","sidebarTitle":"Versions and compatibility","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/code.svg","href":"/widget/versions"},{"title":"Troubleshoot the widget","sidebarTitle":"Troubleshooting","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/help.svg","href":"/widget/troubleshooting"}]},{"group":"iOS SDK","pages":[{"title":"iOS SDK overview","sidebarTitle":"Overview","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/book-open.svg","href":"/ios-sdk/overview"},{"title":"Install the iOS SDK","sidebarTitle":"Install","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/code.svg","href":"/ios-sdk/install"},{"title":"Identify customers","sidebarTitle":"Identity","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/key.svg","href":"/ios-sdk/identity"},{"title":"Self-service sign-in","sidebarTitle":"Self-service sign-in","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/key.svg","href":"/ios-sdk/self-service-auth"},{"title":"Unread count","sidebarTitle":"Unread count","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/bell.svg","href":"/ios-sdk/notifications"},{"title":"Diagnostics and privacy","sidebarTitle":"Diagnostics \u0026 privacy","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/sliders.svg","href":"/ios-sdk/diagnostics"},{"title":"Troubleshooting","sidebarTitle":"Troubleshooting","icon":"https://mintlify.s3.us-west-1.amazonaws.com/gleanfeed/icons/filled/help.svg","href":"/ios-sdk/troubleshooting"}]}]}]},"basePath":"","title":"Use the widget with React - Glean Feed","deploymentId":"dpl_DPZjiNpvAcGiwobuijLfKPtJL4Ux","buildId":"dpl_DPZjiNpvAcGiwobuijLfKPtJL4Ux","dynamics":[],"chunks":[]}