$file

Read packaged files and JSON from the script bundle.

read(path)readJSON(path)

Example

//
// ScriptWidget
// https://xnu.app/scriptwidget
//
// Usage for api file
//

// read as string
console.log($file.read("data.json"));

// read as json
let json = $file.readJSON("data.json");
console.log(json);
console.log(json.name);
HealthKit and Location data are only available after user authorization in the main app. Widgets may show cached or fallback data.