Current behavior: All traffic flagged as bot by botid.
Expected behavior: Humans should be flagged as humans.
Running a nuxt app. Using several nuxt core team modules will include below. Basically followed the nuxt setup from the botid docs exactly as listed, but all traffic is being flagged as bot traffic when attempting to access protected api routes. Current setup is below:
//nuxt.config.ts
import { defineLocalBusiness } from 'nuxt-schema-org/schema'
export default defineNuxtConfig({
modules: [
'botid/nuxt',
'@nuxt/eslint',
'@nuxt/image',
'@nuxtjs/seo',
'@nuxt/ui',
'nuxt-llms',
'@nuxt/content',
'@vueuse/nuxt',
'nuxt-og-image',
'@nuxt/fonts',
'@pinia/nuxt',
'pinia-plugin-persistedstate/nuxt',
'@nuxtjs/algolia',
'nuxt-vitalizer',
'@nuxt/scripts',
'nuxt-security',
],
...
//server/api/contact/test.post.ts
import { defineEventHandler, readValidatedBody, createError, setResponseStatus, getRequestIP } from 'h3';
import { checkBotId } from 'botid/server';
export default defineEventHandler(async (event) => {
const headers = getRequestHeaders(event);
console.log('Received Headers:', headers);
const verification = await checkBotId();
console.log('BotID Verification:', verification);
console.log('Incoming Request Headers:', headers);
if (verification.isBot) {
console.warn('Bot traffic detected. Logging for now...');
/* throw createError({
statusCode: 403,
statusMessage: 'Access denied',
message: 'Bot traffic is not allowed to submit this form.'
}); */
} else {
console.log('Human traffic verified. Proceeding with form submission.');
}
return verification;
});
//app/plugins/botid.client.ts
import { initBotId } from 'botid/client/core';
export default defineNuxtPlugin({
enforce: 'pre',
setup() {
console.log('Initializing BotId plugin...');
initBotId({
protect: [{ path: '/api/contact/submit', method: 'POST' }, { path: '/api/contact/test', method: 'POST' }],
});
console.log('BotId plugin initialized.');
},
});
I have tried manually setting the headers by using:
const headers = getRequestHeaders(event);
console.log('Received Headers:', headers);
const verification = await checkBotId({ advancedOptions: { headers: headers }});
I have tried asking gemini, claude, vercelās support ai, r/nuxt, r/vercel. All with no success. Looking for someone who can help get this configured properly. I am hosting directly on vercel.
landworks-website.vercel.app
nuxt

