Skip to content

Latest commit

 

History

History
70 lines (48 loc) · 2.38 KB

README.md

File metadata and controls

70 lines (48 loc) · 2.38 KB

ExOura

Hex.pm Hex Docs Build Status Coverage Status Last Updated License

An Elixir client for the Oura API, leveraging the OpenAPI v1.23 specification.

An Elixir library for interacting with the Oura API with a base client generated using OpenAPI Code Generator from Oura OpenAPI specs v1.23. It supports basic functionality for tertrieving data from Oura, such as activity, readiness, and sleep metrics.

Features

  • Basic authorization support (OAuth2 support is on the roadmap)
  • Fetch data such as activity, readiness, and sleep metrics
  • Built on the robust Elixir ecosystem
  • Compatible with OpenAPI v1.23

Installation

Add ex_oura to your list of dependencies in mix.exs:

def deps do
  [
    {:ex_oura, "~> 1.0.0"}
  ]
end

Usage

Currently, the client support only a basic authorization and you should obtain an access token here.

Using configuration via config.exs:

config :ex_oura,
  access_token: "<YOUR_PERSONAL_ACCESS_TOKEN>"

Inline configuration:

acces_token = "<YOUR_PERSONAL_ACCESS_TOKEN>"
ExOura.Client.start_link(access_token)

Once configured, you can fetch data from Oura as follows:

{:ok, client} = ExOura.Client.start_link("<YOUR_PERSONAL_ACCESS_TOKEN>")

# Example: Fetch daily activity data
{:ok, activity_data} = client.fetch_activity_data()
IO.inspect(activity_data)

Oura OpenAPI issues

A few issues in the Oura spec that I came across during the implementation:

  • no title for tag/timestamp
  • daily cardiovascular age has no ID -> no way to query a single document

License

This project is licensed under the MIT License.