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

x/oura_api/src/OuraOAuth.ts>default

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

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

Constructors

new
default(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.

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.