Skip to content

Commit 08b980a

Browse files
committed
dont allow api key to be exposed to client
1 parent 0575af2 commit 08b980a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/providers/Stream.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ export const StreamProvider: React.FC<{ children: ReactNode }> = ({
131131
const envApiUrl: string | undefined = process.env.NEXT_PUBLIC_API_URL;
132132
const envAssistantId: string | undefined =
133133
process.env.NEXT_PUBLIC_ASSISTANT_ID;
134-
const envApiKey: string | undefined =
135-
process.env.NEXT_PUBLIC_LANGSMITH_API_KEY;
136134

137135
// Use URL params with env var fallbacks
138136
const [apiUrl, setApiUrl] = useQueryState("apiUrl", {
@@ -145,7 +143,7 @@ export const StreamProvider: React.FC<{ children: ReactNode }> = ({
145143
// For API key, use localStorage with env var fallback
146144
const [apiKey, _setApiKey] = useState(() => {
147145
const storedKey = getApiKey();
148-
return storedKey || envApiKey || "";
146+
return storedKey || "";
149147
});
150148

151149
const setApiKey = (key: string) => {
@@ -157,7 +155,7 @@ export const StreamProvider: React.FC<{ children: ReactNode }> = ({
157155
const finalApiUrl = apiUrl || envApiUrl;
158156
const finalAssistantId = assistantId || envAssistantId;
159157

160-
// If we're missing any required values, show the form
158+
// Show the form if we: don't have an API URL, or don't have an assistant ID
161159
if (!finalApiUrl || !finalAssistantId) {
162160
return (
163161
<div className="flex items-center justify-center min-h-screen w-full p-4">

0 commit comments

Comments
 (0)