Coder Social home page Coder Social logo

gatsby-source-strava's Introduction

gatsby-source-strava

npm package

Gatsby plugin to use Strava as a data source

Getting started

gatsby-source-strava

You can download gatsby-source-strava from the NPM registry via the npm or yarn commands

yarn add gatsby-source-strava
npm install gatsby-source-strava --save

Usage

Add the plugin in your gatsby-config.js file:

const STRAVA_TOKEN = "your-token"
module.exports = {
    plugins: [
        {
            resolve: "gatsby-source-strava",
            options: {
                //
                // Mandatory
                // --------
                //
                token: STRAVA_TOKEN,

                //
                // Optional
                // --------
                //
                debug: true,
                activitiesOptions: {
                    // Options for filtering activities
                    // --------------------------------
                    //
                    // Timestamp for filtering activities that have taken place BEFORE a certain time
                    before: "1539500400",
                    // Timestamp for filtering activities that have taken place AFTER a certain time
                    after: "1539500400",
                    //
                    // Options for enhance activities
                    // --------------------------------
                    //
                    // Add comments to every activity
                    withComments: true,
                    // Add kudos to every activity
                    withKudos: true,
                    // Add laps to every activity
                    withLaps: true,
                    // Add photos to every activity
                    withPhotos: true,
                    // Add related activities to every activity
                    withRelated: true,
                    // Add streams to every activity (see streamTypes)
                    withStreams: true,
                    // Add zones to every activity (need Strava Summit Analysis Pack)
                    withZones: true,
                    //
                    // Add analyzed data to every activity
                    // withStreams option must be true
                    // See https://developers.strava.com/docs/reference/#api-models-StreamSet
                    streamsTypes: [
                        "time",
                        "cadence",
                        "distance",
                        "latlng",
                        "heartrate",
                        "temp",
                        "moving",
                        "grade_smooth",
                        "watts",
                        "velocity_smooth",
                        "altitude",
                    ],
                    //
                    // Option to cache activities
                    // ------
                    cacheDir: `${__dirname}/.strava`,
                },
                athleteOptions: {
                    // Options computed by gatsby-source-strava
                    // ----------------------------------------
                    //
                    // Add `heartrateMax` data to `athlete`
                    computeHeartrateMax: true,
                    //
                    // Options for enhance athlete data
                    // --------------------------------
                    //
                    // Add athlete koms
                    withKoms: true,
                    // Add athlete routes
                    withRoutes: true,
                    // Add athlete stats
                    withStats: true,
                    // Add athlete zones
                    withZones: true,
                },
            },
        },
    ],
}

Contributing

  • โ‡„ Pull/Merge requests and โ˜… Stars are always welcome.
  • For bugs and feature requests, please create an issue.

See CONTRIBUTING guidelines

Changelog

See CHANGELOG

License

This project is licensed under the MIT License - see the LICENCE file for details

gatsby-source-strava's People

Contributors

cedricdelpoux avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.