Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Strava

Gets rides and activities from Strava.

Hierarchy

  • any
    • Strava

Index

Properties

timerPay

timerPay: any

Timer to trigger the payments (via setTimeout).

Accessors

authUrl

  • get authUrl(): string
  • The authentication URL used to start the OAuth2 flow with Strava.

    Returns string

Static Export assignment Instance

Methods

getActivities

  • getActivities(query: any): Promise<Activity[]>
  • Get list of activities from Strava.

    Parameters

    • query: any

      Query options, currently only supports "since".

    Returns Promise<Activity[]>

getAthlete

  • getAthlete(): Promise<any>
  • Get general info for the logged user.

    Returns Promise<any>

getOAuthToken

  • getOAuthToken(code: string): Promise<boolean>
  • Get the OAuth2 access token based on the provided authorization code. This method will return null when it fails to get the token.

    Parameters

    • code: string

      The authorization code provided via the /strava/auth/callback URL.

    Returns Promise<boolean>

getRecentActivities

  • getRecentActivities(since: number): Promise<Activity[]>
  • Get recent activities from Strava (today is always excluded).

    Parameters

    • since: number

      Since that many days, for example 7 gets all activities for last 7 days excluding today.

    Returns Promise<Activity[]>

init

  • init(): Promise<void>
  • Init the Strava module by setting up the payment timer.

    Returns Promise<void>

makeRequest

  • makeRequest(path: string, params?: any): Promise<any>
  • Internal implementation to make a request to the Strava API.

    Parameters

    • path: string

      The API path.

    • Optional params: any

      Additional parameters to be passed.

    Returns Promise<any>

payForActivities

  • payForActivities(): Promise<any>
  • Make a payment regarding the mileage of recent activities.

    Returns Promise<any>

refreshToken

  • refreshToken(): Promise<void>
  • Refresh OAuth2 tokens from Strava.

    Returns Promise<void>

Generated using TypeDoc