Bot detected: {{ botName }} ({{ botCategory }})
```
See the [`useBotDetection()`](https://nuxtseo.com/docs/robots/api/use-bot-detection) API docs for full usage details.
## Fingerprinting with BotD
When using `fingerprint: true`, the composable will load the [BotD](https://github.com/fingerprintjs/BotD){rel="nofollow"}
library when the window is idle and perform client-side fingerprinting to detect advanced bots and automation tools.
### Performance Considerations
This fingerprinting is computationally expensive for end users' CPUs, so you should be mindful of when you enable it. For example, you may consider only enabling it for sensitive pages where bot detection is critical.
That said, the composable aims to be performant and will cache the bot result in the user's local storage under the `'__nuxt_robots:botd'` key so it will only run once.
```ts
localStorage.getItem('__nuxt_robots:botd') // returns the cached bot detection result - used internally already
```
### Watching For Fingerprinting
The properties returned from the composable are all `ref`s. It's important to watch these for changes if you're using fingerprinting, as the results will not be immediately available when the composable is called.
```ts
import { useBotDetection } from '#robots/app/composables/useBotDetection'
import { watch } from 'vue'
const { isBot } = useBotDetection({
fingerprint: true,
})
watch(isBot, (detected) => {
if (detected) {
console.log(`Bot detected!`)
}
})
```
Alternatively you can use the `onFingerprintResult` callback to handle the result when fingerprinting completes.
```ts
import { useBotDetection } from '#robots/app/composables/useBotDetection'
const botd = useBotDetection({
fingerprint: true,
onFingerprintResult(result) {
// Fingerprinting completed
console.log('Detection result:', result)
},
})
```
# useRobotsRule()
## Introduction
**Type:** `function useRobotsRule(rule?: MaybeRef