Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/oura_api/mod.ts>OuraOAuth

Typescript project to interact with v2 of the Oura Ring API
Latest
class OuraOAuth
extends OuraBase
Re-export
import { OuraOAuth } from "https://deno.land/x/oura_api@1.0.1/mod.ts";

Base class for the OuraOAuth API. Class containing all the methods to access the Oura API with OAuth2 Authentication.

Constructors

new
OuraOAuth(options: ApiOptionsOAuth)

Creates a new Oura API client.

Methods

protected
fetchData(
endpoint: string,
params?: Record<string, string>,
accessToken?: string,
): Promise<unknown>

Fetches data from the Oura API using an OAuth2 access token.

exchangeCodeForToken(code: string): Promise<OAuth2TokenResponse>

Exchanges an authorization code for an access token and refresh token.

generateAuthUrl(scopes: OAuthScope[], state?: string): string

Generates the authorization URL for the Oura OAuth2 flow.

refreshAccessToken(suppliedRefreshToken: string): Promise<OAuth2TokenResponse>

Refreshes an expired OAuth2 access token using a refresh token.

revokeAccessToken(accessToken: string): Promise<boolean>

Revoke an OAuth2 access token.