health_forge_oura 0.1.1 copy "health_forge_oura: ^0.1.1" to clipboard
health_forge_oura: ^0.1.1 copied to clipboard

Oura Ring REST API adapter for health_forge — fetches sleep, heart rate, readiness, stress, and activity via OAuth 2.0 PKCE with rate limiting.

example/example.dart

// Examples print to stdout for demonstration purposes only.
// ignore_for_file: avoid_print

import 'package:health_forge_oura/health_forge_oura.dart';

/// Wires up the Oura Ring adapter with OAuth 2.0 PKCE.
///
/// Replace the `clientId` and `redirectUri` with values from your registered
/// app at https://cloud.ouraring.com/oauth/applications. The `urlLauncher`
/// callback opens the auth URL in the user's browser and returns the
/// redirect-callback URL once they complete the flow.
void main() {
  final authManager = OuraAuthManager(
    clientId: 'YOUR_OURA_CLIENT_ID',
    redirectUri: 'healthforge://oura/callback',
    urlLauncher: (authUrl) async {
      // In a real app: launch the browser and await the deep-link callback.
      print('Open in browser: $authUrl');
      return null;
    },
  );

  final apiClient = OuraApiClient(authManager: authManager);
  final provider = OuraHealthProvider(
    authManager: authManager,
    apiClient: apiClient,
  );

  final metrics = provider.capabilities.supportedMetrics;
  print('${provider.displayName} supports ${metrics.length} metric type(s).');
}
0
likes
160
points
131
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Oura Ring REST API adapter for health_forge — fetches sleep, heart rate, readiness, stress, and activity via OAuth 2.0 PKCE with rate limiting.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#health #oura #wearables #sleep-tracking #rest-api

License

MIT (license)

Dependencies

crypto, dio, flutter, health_forge_core

More

Packages that depend on health_forge_oura