
Dat Conventions
- 5 installs
- 500 repo stars
- Updated August 3, 2026
- facebook/meta-wearables-dat-ios
Reference for Swift async/await patterns, naming conventions, module layout, and key types when building Meta Wearables DAT SDK iOS apps.
About
Documents DAT SDK iOS conventions including async/await usage, AsyncSequence observation, @MainActor rules, and the four modules. iOS developers use it as the baseline convention reference across a DAT SDK integration.
- Fully async SDK using async/await and AsyncSequence
- Four modules: Core, Camera, Display, MockDevice
Dat Conventions by the numbers
- 5 all-time installs (skills.sh)
- Ranked #828 of 1,039 Mobile Development skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/facebook/meta-wearables-dat-ios --skill dat-conventionsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 5 |
|---|---|
| repo stars | ★ 500 |
| Last updated | August 3, 2026 |
| Repository | facebook/meta-wearables-dat-ios ↗ |
What it does
Reference for Swift async/await patterns, naming conventions, module layout, and key types when building Meta Wearables DAT SDK iOS apps.
Files
DAT SDK Conventions (iOS)
Architecture
The SDK is organized into four modules:
- MWDATCore: Device discovery, registration, permissions, device selectors
- MWDATCamera: Stream, VideoFrame, photo capture
- MWDATDisplay: Display capability, display UI components, icons, images, buttons, video
- MWDATMockDevice: MockDeviceKit for testing without hardware
Swift Patterns
- Use
async/awaitfor all SDK operations — the SDK is fully async - Use
AsyncSequence/ publisher.listen {}for observing streams - Annotate UI-updating code with
@MainActor - Never block the main thread with frame processing
- Handle errors with do/catch — the SDK throws typed errors
Naming Conventions
| Type | Convention | Example |
|---|---|---|
| Entry point | Wearables.shared | Wearables.shared.startRegistration() |
| Device sessions | *Session | DeviceSession |
| Capabilities | Named by function | Stream |
| Selectors | *DeviceSelector | AutoDeviceSelector, SpecificDeviceSelector |
| Config | *Configuration | StreamConfiguration |
| Publishers | *Publisher | statePublisher, videoFramePublisher |
Imports
import MWDATCore // Registration, devices, permissions
import MWDATCamera // Stream, VideoFrame, photo capture
import MWDATDisplay // Display, FlexBox, Text, Button, Image, Icon, VideoPlayerFor testing:
import MWDATMockDevice // MockDeviceKit, MockRaybanMeta, MockCameraKitKey Types
Wearables— SDK entry point. CallWearables.configure()at launch, then useWearables.sharedStream— Camera streaming session. Create with config + device selectorDisplay— Display capability attached to a started DeviceSessionVideoFrame— Individual video frame with.makeUIImage()convenienceAutoDeviceSelector— Automatically selects the best available deviceSpecificDeviceSelector— Selects a specific device by identifierStreamConfiguration— Configure video codec, resolution, frame rateMockDeviceKit— Factory for creating simulated devices in tests
Error Handling
do {
try Wearables.configure()
} catch {
// Handle configuration error
}
do {
try await Wearables.shared.startRegistration()
} catch {
// Handle registration error
}Build and Test
# Install dependencies via Swift Package Manager
# In Xcode: File > Add Package Dependencies > enter repo URL
# Build from command line
xcodebuild -scheme MWDATCore -destination 'platform=iOS Simulator,name=iPhone 16'
# Run tests
xcodebuild test -scheme MWDATCoreTests -destination 'platform=iOS Simulator,name=iPhone 16'For sample apps:
# Open the sample app workspace
open ExternalSampleApps/CameraAccess/CameraAccess.xcodeproj
# Build and run on simulator (uses MockDeviceKit - no glasses needed)
xcodebuild -scheme CameraAccess -destination 'platform=iOS Simulator,name=iPhone 16'Development Workflow
1. Add SDK via Swift Package Manager (SPM) in Xcode 2. Import modules (MWDATCore, MWDATCamera, MWDATDisplay when rendering Display content) 3. Configure at app launch: try Wearables.configure() 4. Build with Xcode or xcodebuild 5. Test with MockDeviceKit - no physical glasses required 6. Debug using Xcode console for SDK logs
Live docs search
If your editor supports remote MCP servers, connect https://mcp.facebook.com/wearables_dat and use search_dat_docs for current DAT setup, session lifecycle, camera streaming, MockDeviceKit, permissions, and exact API symbols.
Use llms.txt when your tool only supports static reference context.