Skip to main content

Overview

Returns the MAC address of the device. Optionally accepts a configuration object to specify a network interface.
const useMacAddress: (config?: { network_interface?: string }) => string | undefined

Usage

Default Network Interface

import { useMacAddress } from 'node-fullykiosk';

function DeviceInfo() {
  const macAddress = useMacAddress();

  return (
    <div>
      <h2>MAC Address</h2>
      <p>{macAddress || 'Not available'}</p>
    </div>
  );
}

Specific Network Interface

import { useMacAddress } from 'node-fullykiosk';

function NetworkInterfaces() {
  const wifiMac = useMacAddress({ network_interface: 'wlan0' });
  const ethernetMac = useMacAddress({ network_interface: 'eth0' });

  return (
    <div>
      <h2>Network Interfaces</h2>
      <p>WiFi (wlan0): {wifiMac || 'Not available'}</p>
      <p>Ethernet (eth0): {ethernetMac || 'Not available'}</p>
    </div>
  );
}

Parameters

config
object
Configuration object for specifying network interface.

Return Value

macAddress
string | undefined
The MAC address of the specified network interface (e.g., “00:1A:2B:3C:4D:5E”), or undefined if Fully Kiosk Browser is not available.

Build docs developers (and LLMs) love