From 5c941dd830f97a3ccc2a1886ad421955878c1931 Mon Sep 17 00:00:00 2001 From: dancer <144584931+dancer@users.noreply.github.com> Date: Mon, 2 Mar 2026 15:14:01 +0000 Subject: [PATCH] fix: temporarily remove botid from demo (#1438) --- app/(chat)/api/chat/route.ts | 10 +--------- instrumentation-client.ts | 11 +---------- next.config.ts | 3 +-- package.json | 1 - pnpm-lock.yaml | 19 ------------------- vercel.json | 10 ---------- 6 files changed, 3 insertions(+), 51 deletions(-) diff --git a/app/(chat)/api/chat/route.ts b/app/(chat)/api/chat/route.ts index 1f0b5b2..80bd35e 100644 --- a/app/(chat)/api/chat/route.ts +++ b/app/(chat)/api/chat/route.ts @@ -7,7 +7,6 @@ import { stepCountIs, streamText, } from "ai"; -import { checkBotId } from "botid/server"; import { after } from "next/server"; import { createResumableStreamContext } from "resumable-stream"; import { auth, type UserType } from "@/app/(auth)/auth"; @@ -64,14 +63,7 @@ export async function POST(request: Request) { const { id, message, messages, selectedChatModel, selectedVisibilityType } = requestBody; - const [botResult, session] = await Promise.all([ - checkBotId().catch(() => null), - auth(), - ]); - - if (botResult?.isBot) { - return new ChatbotError("unauthorized:chat").toResponse(); - } + const session = await auth(); if (!session?.user) { return new ChatbotError("unauthorized:chat").toResponse(); diff --git a/instrumentation-client.ts b/instrumentation-client.ts index 2f899da..cb0ff5c 100644 --- a/instrumentation-client.ts +++ b/instrumentation-client.ts @@ -1,10 +1 @@ -import { initBotId } from "botid/client/core"; - -initBotId({ - protect: [ - { - path: `${process.env.NEXT_PUBLIC_BASE_PATH ?? ""}/api/chat`, - method: "POST", - }, - ], -}); +export {}; diff --git a/next.config.ts b/next.config.ts index 2a42780..15d4f1a 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,4 +1,3 @@ -import { withBotId } from "botid/next/config"; import type { NextConfig } from "next"; const basePath = "/demo"; @@ -25,4 +24,4 @@ const nextConfig: NextConfig = { }, }; -export default withBotId(nextConfig); +export default nextConfig; diff --git a/package.json b/package.json index ca66ed5..5cccc5f 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,6 @@ "@xyflow/react": "^12.10.0", "ai": "6.0.37", "bcrypt-ts": "^5.0.2", - "botid": "1.5.6", "class-variance-authority": "^0.7.1", "classnames": "^2.5.1", "clsx": "^2.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ed5cba2..52f4ccc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -101,9 +101,6 @@ importers: bcrypt-ts: specifier: ^5.0.2 version: 5.0.3 - botid: - specifier: 1.5.6 - version: 1.5.6(next@16.0.10(@opentelemetry/api@1.9.0)(@playwright/test@1.51.0)(react-dom@19.0.1(react@19.0.1))(react@19.0.1))(react@19.0.1) class-variance-authority: specifier: ^0.7.1 version: 0.7.1 @@ -2507,17 +2504,6 @@ packages: resolution: {integrity: sha512-2FcgD12xPbwCoe5i9/HK0jJ1xA1m+QfC1e6htG9Bl/hNOnLyaFmQSlqLKcfe3QdnoMPKpKEGFCbESBTg+SJNOw==} engines: {node: '>=18'} - botid@1.5.6: - resolution: {integrity: sha512-KElecPjc1z6WJ6sCJMw6CvLo/CQclwlLJdobqmtOjVqvCXZZmaWvNafVDwBk0Kf5ordIaorDa3YkIx2OlGx7pg==} - peerDependencies: - next: '*' - react: ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - next: - optional: true - react: - optional: true - buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} @@ -5990,11 +5976,6 @@ snapshots: bcrypt-ts@5.0.3: {} - botid@1.5.6(next@16.0.10(@opentelemetry/api@1.9.0)(@playwright/test@1.51.0)(react-dom@19.0.1(react@19.0.1))(react@19.0.1))(react@19.0.1): - optionalDependencies: - next: 16.0.10(@opentelemetry/api@1.9.0)(@playwright/test@1.51.0)(react-dom@19.0.1(react@19.0.1))(react@19.0.1) - react: 19.0.1 - buffer-from@1.1.2: {} bufferutil@4.0.9: diff --git a/vercel.json b/vercel.json index 62abe29..ced26d3 100644 --- a/vercel.json +++ b/vercel.json @@ -1,15 +1,5 @@ { "framework": "nextjs", - "rewrites": [ - { - "source": "/149e9513-01fa-4fb0-aad4-566afd725d1b/2d206a39-8ed7-437e-a3be-862e0f06eea3/a-4-a/c.js", - "destination": "https://api.vercel.com/bot-protection/v1/challenge" - }, - { - "source": "/149e9513-01fa-4fb0-aad4-566afd725d1b/2d206a39-8ed7-437e-a3be-862e0f06eea3/:path*", - "destination": "https://api.vercel.com/bot-protection/v1/proxy/:path*" - } - ], "redirects": [ { "source": "/",