Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.
/ oura Public archive

💍 An unofficial Go client for the Oura Cloud API – Archived in favour of using https://github.com/deepmap/oapi-codegen to generate the libs.

License

Notifications You must be signed in to change notification settings

lildude/oura

Repository files navigation

Oura

Tests Status Badge

An unofficial Go client for the Oura Cloud API.

Installation

Use Go to fetch the latest version of the package.

go get -u 'github.com/lildude/oura'

Usage

Depending on your requirements, you will need an access token to query the API. This can be a personal access token or a full OAuth2 authenticated access token.

See the section on Authentication in the Oura Cloud API Docs for more information the authentication methods.

The simplest approach for accessing your own data is to use a personal access token like this:

package main

import (
  "context"
  "fmt"
  "os"

  "github.com/joho/godotenv"
  "github.com/lildude/oura"
  "golang.org/x/oauth2"
)

func main() {
  godotenv.Load(".env")
  ts := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: os.Getenv("OURA_ACCESS_TOKEN")})
  ctx := context.Background()
  tc := oauth2.NewClient(ctx, ts)

  cl := oura.NewClient(tc)

  userInfo, _, _err_ := cl.UserInfo(ctx)
  if err != nil {
    fmt.Println(err)
  }
  fmt.Println(userInfo.Age, userInfo.Gender, userInfo.Weight, userInfo.Email)
}

Releasing

This project uses GoReleaser via GitHub Actions to make the releases quick and easy. When I'm ready for a new release, I push a new tag and the workflow takes care of things.

About

💍 An unofficial Go client for the Oura Cloud API – Archived in favour of using https://github.com/deepmap/oapi-codegen to generate the libs.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors 5

Languages