Skip to content

Latest commit

 

History

History
51 lines (39 loc) · 912 Bytes

README.md

File metadata and controls

51 lines (39 loc) · 912 Bytes

Cloudflare Device Detector

Lightweight and fast device detector that works with Cloudflare Workers and Edge Runtime.

Features

  • 🚀 Works in Edge Runtime
  • 💪 TypeScript support
  • 🔍 Accurate device detection
  • 🤖 Bot detection
  • 🌐 Browser detection
  • 📱 Device detection
  • 💻 OS detection
  • ⚡ Zero dependencies
  • 🔒 Type safe

Installation

Standalone Version

npm install cloudflare-device-detector

Nuxt Module

npm install nuxt-device-detector

Usage

Standalone

import { DeviceDetector } from 'cloudflare-device-detector';

const detector = new DeviceDetector();
const result = detector.parse(userAgent);

Nuxt Module

// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxt-device-detector']
})

// In your component
const { isMobile, browserName, osName } = useDevice();

License

MIT