geolocation: ''
microphone: ''
notifications: ''
camera: ''
midi: ''

usePermission

Reactive Permissions API. The Permissions API provides the tools to allow developers to implement a better user experience as far as permissions are concerned.

Usage

import { usePermission } from '@vueuse/core'

const microphoneAccess = usePermission('microphone')

Type Declarations

declare type DescriptorNamePolyfill = "clipboard-read" | "clipboard-write"
export declare type GeneralPermissionDescriptor =
  | PermissionDescriptor
  | DevicePermissionDescriptor
  | MidiPermissionDescriptor
  | PushPermissionDescriptor
  | {
      name: DescriptorNamePolyfill
    }
/**
 * Reactive Permissions API.
 *
 * @see   {@link /usePermission}
 * @param permissionDesc
 * @param options
 */
export declare function usePermission(
  permissionDesc:
    | GeneralPermissionDescriptor
    | GeneralPermissionDescriptor["name"],
  options?: ConfigurableNavigator
): Ref<"" | "denied" | "granted" | "prompt">
export {}

Source

SourceDemoDocs