pkg:clod/com.clodhub/preferences 0.9.0 Language, sound, camera and microphone choices, kept per device. `preferences` keeps what a person chose on one device: the language they picked (or none, to follow the device), whether sound is on, whether the microphone and the camera are on, and which camera and microphone they chose (none means automatic). It reads and writes the device's own storage, tells listeners when a value changes, resets everything to the defaults, and works out whether a saved device is still plugged in. The buttons that change these values belong to controls and video-calls; choosing the text of a language belongs to translations. Examples A person picks French on the home screen: the next launch starts in French. They turn sound off: every later sound is skipped until they turn it on. They choose an external camera, unplug it and start the application: the camera falls back to automatic but the choice is kept for when it returns. They reset the hints and preferences: everything is back to the device's language and the defaults. Package URL: pkg:clod/com.clodhub/preferences@0.9.0 Class: Preferences (pkg:clod/com.clodhub/preferences-class@1.1.0): Per-device choices such as sound and language, kept and observed. Any component of this class can fill a recipe slot that asks for it. Category people-and-accounts/preferences; https://clodhub.com/classes/preferences-class.txt; 0 other components of this class: https://clodhub.com/components.txt?class=pkg%3Aclod%2Fcom.clodhub%2Fpreferences-class Provides (1) - preferences (com.clodhub/preferences 1.0.0): What a person chose on this device: language, sound, camera and microphone, kept on the device only. TypeScript (web/preferences.ts, tagged typescript) over string storage; Swift final class DevicePreferences over UserDefaults (PreferenceStorage) and Kotlin class com.clodhub.preferences.DevicePreferences over SharedPreferences (PreferenceStorage), with Bool values, tagged swift and kotlin. The native classes expose the six preferences as read-write properties (DevicePreferences.) and call didChange(name) after each change. components that use it: https://clodhub.com/components.txt?requires=com.clodhub%2Fpreferences Requires (0) - none Settings (3) Three settings give the defaults for a device that has never chosen: `defaultSound` (default true), `defaultMicrophoneOn` (true) and `defaultCameraOn` (true). Language and device choices have no default beyond "follow the device" and "automatic". - defaultSound: boolean; optional, default true - defaultMicrophoneOn: boolean; optional, default true - defaultCameraOn: boolean; optional, default true Depends on components: none How to use in a recipe A recipe uses it through a slot of class Preferences (pkg:clod/com.clodhub/preferences-class 1.1.0), naming pkg:clod/com.clodhub/preferences as the slot's preferred component or substituting it for another component of the class. The recipe connects what it provides (preferences) to the slots that use it. The recipe sets defaultSound, defaultMicrophoneOn and defaultCameraOn; any it leaves out takes its default. - as a slot in recipe.json components: {"id":"preferences","class":{"name":"pkg:clod/com.clodhub/preferences-class","version":"1.1.0","digest":"e69d13f4df14da9a6350429fe9ddfe6dbaf6f24d3c1991c46f247ae109c22aa1"},"preferred":{"name":"pkg:clod/com.clodhub/preferences","version":"0.9.0"}} - in place of another component of the class: clod fetch preferences@0.9.0 --store store --from https://clodhub.com, then clod design RECIPE@VERSION --store store --answers answers.json --substitute SLOT=preferences@0.9.0 --out definition.json Used by recipes: pkg:clod/com.clodhub/ourpoker-recipe 0.13.0 (slot preferences) For developers: how an application uses it Web: `createPreferences(localStorage, defaults)`; read with `get`, change with `set`, react with `subscribe`. Sound-making code reads `get("sound")` before each sound, the video component reads the device and on-off choices when it connects and writes them when the person changes them, and the language component reads `get("language")` (null follows the browser). Apple and Android: `DevicePreferences` over `UserDefaults` or `SharedPreferences` (behind the small `PreferenceStorage` interface), with `didChange` for updates. `availableDeviceId` (all platforms) turns a saved device into `""` when it is no longer present. `examples/consumer.ts` is a settings model that applies the choices. The sound-cues and guided-tour components require this interface. Accounts and services No service. Values live in the device's own storage (browser local storage, UserDefaults, SharedPreferences) and are never sent anywhere. How it is checked Required-local: `node --test tests/web.test.ts` checks defaults, the default storage keys and on/off encoding, removal when returning to automatic, listeners, reset, missing devices, ndjson export and import with rejected lines, and the example. Platform: `python3 tests/native.py apple` compiles and runs the Swift checks; `python3 tests/native.py android` compiles the Kotlin checks (needs kotlinc, not installed on the authoring machine, so not run there). - `node --test tests/web.test.ts` (web, required-local; tools: node 26.5) - `python3 tests/native.py apple` (apple, platform; tools: python3 3.12, swiftc 6.4) - `python3 tests/native.py android` (android, platform; tools: python3 3.12, kotlinc 2.2, java 26.0) Updates Patch updates replace files. The stored values are small per-device choices described in `migration.json`; the default keys are `lang`, `sound`, `micOn`, `camOn`, `cameraDeviceID` and `microphoneDeviceID`. Removal deletes the owned code; stored choices remain on the device until the application clears them. Tags: people-and-accounts, preferences Targets: client android, ios, macos, tvos, web, windows; server none Publisher: George McIntyre (george-mcintyre) Guardians: Level N Ltd (guardian key 08775f20) Source: clodhub/preferences release v0.9.0; digest sha256:69c26838999e368b1e141cffbb30b921dea74be970e5b41f1422b8acbca7214b Release: features Line 0.9: no security releases Quality: Integration-tested, certified Known vulnerabilities: none known (checked 2026-11-26 at OSV); https://clodhub.com/api/components/preferences/0.9.0/vulnerabilities Downloads: 1 in 30 days; 1 of this version Classes: https://clodhub.com/classes.txt; this component as JSON: https://clodhub.com/api/components/preferences/0.9.0 Bundle download: GET https://clodhub.com/api/components/preferences/0.9.0/bundle returns a link valid for one hour Implements: pkg:clod/com.clodhub/preferences-class@1.1.0 e69d13f4df14da9a6350429fe9ddfe6dbaf6f24d3c1991c46f247ae109c22aa1 com.clodhub/preferences 1.0.0 entry modules: android android/src/main/java, ios apple/Sources, macos apple/Sources, tvos apple/Sources, web web/index.ts, windows web/index.ts shared behaviour suites: shared Platforms: android, ios, macos, tvos, web, windows Toolchains: android >=8.0.0, ios >=17.0.0, java >=17.0.0 <27.0.0, kotlin =2.4.21, macos >=14.0.0, node >=26.5.0 <27.0.0, swift =6.4.2, tvos >=17.0.0 Frameworks: none Styles: scope none; 0 namespaces; 0 conflicts Licence: Apache-2.0; 0 upstream sources, 0 exact dependencies, 30 files (listed on the details page) Suitable for jobs: preferences profile any: cost none; load none; regions any; compliance none Notes: Pure functions over device storage; no provider involved. Data migration: stores device-preferences (com.clodhub/preference-record 1.0.0); formats ndjson; requires stop no; retention 0 days Maintainers: Level N Ltd; https://github.com/clodhub/preferences/issues; updates https://github.com/clodhub/preferences/releases (manual) What you download preferences-0.9.0.tar, from release v0.9.0 of clodhub/preferences: 30 files - Documents and manifests (9): CONTRACT.md, INSTRUCTIONS.md, LICENCE, NOTICE, PROVENANCE.md, SOURCE.md, ... - Source code (4): android/ (1), apple/ (1), web/ (2) - Tests (6): android/ (1), apple/ (1), fixtures/ (2), native.py, web.test.ts - Interface documents (2): preference-record.schema.json, preferences.json - Class files: the class's interfaces and shared checks (3): preferences-class/ (3) - Examples (1): consumer.ts - Diagrams (5): definition.json, examples/ (1), output/ (3) Installing copies 4 of them into the application under components/preferences/: android 1, apple 1, web 2 Not included: the values of its settings, which the recipe writes; any secret The archive is a release file on the publisher's public GitHub repository; ClodHub keeps this page and a pointer to the release, not the code. clod checks the archive's sha256 fingerprint before anything is copied, and installing runs none of the package's code. Versions - 0.9.0 features (2026-11-26T11:29:35.506Z) sha256:69c26838999e368b1e141cffbb30b921dea74be970e5b41f1422b8acbca7214b Links Details (package foundations, upstream sources, exact dependencies, styles, class inventories, files): https://clodhub.com/components/preferences/details.txt?version=0.9.0 Page: https://clodhub.com/components/preferences; JSON: https://clodhub.com/api/components/preferences/0.9.0; connections diagram: https://clodhub.com/api/components/preferences/0.9.0/connections.svg Copyright Level N Ltd 2026