Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@capacitor/device

Package Overview
Dependencies
Maintainers
8
Versions
640
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capacitor/device

The Device API exposes internal information about the device, such as the model and operating system version, along with user information such as unique ids.

  • 7.0.0-nightly-20241008T150529.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
103K
decreased by-16.5%
Maintainers
8
Weekly downloads
 
Created

What is @capacitor/device?

@capacitor/device is a Capacitor plugin that provides access to device information such as the device model, operating system, and unique identifiers. It allows developers to retrieve various details about the device on which their app is running.

What are @capacitor/device's main functionalities?

Get Device Info

This feature allows you to retrieve general information about the device, such as the model, operating system, and manufacturer.

const { Device } = require('@capacitor/device');

async function getDeviceInfo() {
  const info = await Device.getInfo();
  console.log(info);
}

getDeviceInfo();

Get Battery Info

This feature allows you to get information about the device's battery status, including the battery level and whether the device is charging.

const { Device } = require('@capacitor/device');

async function getBatteryInfo() {
  const info = await Device.getBatteryInfo();
  console.log(info);
}

getBatteryInfo();

Get Language Code

This feature allows you to retrieve the device's current language code, which can be useful for localization purposes.

const { Device } = require('@capacitor/device');

async function getLanguageCode() {
  const info = await Device.getLanguageCode();
  console.log(info);
}

getLanguageCode();

Get Unique ID

This feature allows you to get a unique identifier for the device, which can be used for tracking or analytics purposes.

const { Device } = require('@capacitor/device');

async function getUniqueId() {
  const info = await Device.getId();
  console.log(info);
}

getUniqueId();

Other packages similar to @capacitor/device

Keywords

FAQs

Package last updated on 08 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc