Skip to content

fix: Disable inkeep if no API key is provided#3017

Merged
bezbac merged 1 commit into
mainfrom
feature/lfe-10008-encountered-a-script-tag-while-rendering-react-component
May 28, 2026
Merged

fix: Disable inkeep if no API key is provided#3017
bezbac merged 1 commit into
mainfrom
feature/lfe-10008-encountered-a-script-tag-while-rendering-react-component

Conversation

@bezbac
Copy link
Copy Markdown
Member

@bezbac bezbac commented May 28, 2026

Greptile Summary

This PR adds a null-safety guard to the useInkeepSettings hook so that Inkeep UI components gracefully return null instead of crashing when NEXT_PUBLIC_INKEEP_API_KEY is absent. The hook's return type changes from InkeepSharedSettings to InkeepSharedSettings | null, and all three consumers (InkeepSearchBar, InkeepSearchButton, InkeepSharedChat) are updated to handle the new null case.

  • useInkeepSettings.ts: returns null early when the API key env var is missing, adds a useEffect mount warning, and removes the non-null assertion (!) from the apiKey field.
  • InkeepSearchBar.tsx: both exported components now perform a null guard on the hook result before rendering.
  • embedded-chat.tsx: InkeepSharedChat adds the same null guard so the Inkeep embedded chat widget is suppressed when unconfigured.

Confidence Score: 5/5

Safe to merge — the change is a straightforward guard that suppresses Inkeep widgets when no API key is configured, and the React hooks order is correct throughout.

All three consumer components handle the new null return correctly, and the hooks (useTheme, usePostHog, useEffect) are all called before the early return in useInkeepSettings, so hook ordering is valid. No logic paths are broken by this change.

No files require special attention.

Reviews (2): Last reviewed commit: "fix: Disable inkeep if no API key is pro..." | Re-trigger Greptile

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label May 28, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
langfuse-docs Ready Ready Preview, Comment May 28, 2026 12:16pm

Request Review

@dosubot dosubot Bot added the documentation Improvements or additions to documentation label May 28, 2026
@github-actions
Copy link
Copy Markdown

@claude review

@bezbac bezbac force-pushed the feature/lfe-10008-encountered-a-script-tag-while-rendering-react-component branch from 19776e8 to 4c1370c Compare May 28, 2026 11:25
@bezbac bezbac changed the title Disable inkeep if no API key is provided fix: Disable inkeep if no API key is provided May 28, 2026
Comment thread components/inkeep/useInkeepSettings.ts Outdated
Comment thread components/inkeep/InkeepSearchBar.tsx
Comment thread components/inkeep/useInkeepSettings.ts Outdated
@bezbac bezbac force-pushed the feature/lfe-10008-encountered-a-script-tag-while-rendering-react-component branch from 4c1370c to 110b696 Compare May 28, 2026 11:56
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels May 28, 2026
Comment thread components/inkeep/useInkeepSettings.ts Outdated
@bezbac bezbac force-pushed the feature/lfe-10008-encountered-a-script-tag-while-rendering-react-component branch from 110b696 to 55fa4b2 Compare May 28, 2026 12:13
@bezbac
Copy link
Copy Markdown
Member Author

bezbac commented May 28, 2026

@greptileai

@bezbac bezbac added this pull request to the merge queue May 28, 2026
@dosubot dosubot Bot added the auto-merge This PR is set to be merged label May 28, 2026
Merged via the queue into main with commit fcd9519 May 28, 2026
17 checks passed
@bezbac bezbac deleted the feature/lfe-10008-encountered-a-script-tag-while-rendering-react-component branch May 28, 2026 12:31
@dosubot dosubot Bot removed the auto-merge This PR is set to be merged label May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant