Skip to content

Device detector for browsers, backend also for edge like Cloudflare workers.

License

Notifications You must be signed in to change notification settings

aligzl/nuxt-device-detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Device detector for browsers, backend also for edge like Cloudflare workers.

Resources

License

Stars

Watchers

Forks

Packages

No packages published