# strava-v3-cli-authenticator

> API for command line apps that need to authenticate with the Strava V3 API

Latest version **0.0.1** (published 2017-06-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install strava-v3-cli-authenticator
pnpm add strava-v3-cli-authenticator
yarn add strava-v3-cli-authenticator
bun add strava-v3-cli-authenticator
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2017-06-25 |
| First published | 2017-06-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Gabriel M Deal |
| Maintainers | gabrielx |
| Keywords | strava, node, api |

## Links

- npm: https://www.npmjs.com/package/strava-v3-cli-authenticator
- Repository: https://github.com/gabrielmdeal/strava-v3-cli-authenticator
- Homepage: https://github.com/gabrielmdeal/strava-v3-cli-authenticator#readme
- Issues: https://github.com/gabrielmdeal/strava-v3-cli-authenticator/issues
- npm.io page: https://npm.io/package/strava-v3-cli-authenticator

## Dependencies (2)

- [opn](https://npm.io/package/opn.md) ^5.1.0
- [request](https://npm.io/package/request.md) ^2.81.0

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2017-06-25

## README

## Synopsis

Node.js API for command-line applications that need to authenticate via the Strava V3 API.

## Code Example

```javascript
  var authorize = require('strava-v3-cli-authenticator');

  const options = {
    clientId: 12345,
	clientSecret: 'x5f111xx11yyyy2222z3aa4b5555c6d777e88f9',
    scope: "write",
    httpPort: 8888
  };
  const callback = (error, accessToken) => {
    if (error) {
      console.error('Failed: ', error);
    } else {
      console.log('Access token: ', accessToken);
    }
  };
  authorize(options, callback);
```

## Motivation

Strava's API is a hassle to use in command-line apps since it depends on pointing the user's browser to Strava, authenticating, then redirecting the brower back to the developer's application with the authentication code.  This package gets around that by running a local HTTP server, starting up a browser, and pointing the Strava redirect to the local HTTP server.

## Installation

`npm install --save strava-v3-cli-authenticator`

## API Reference

### authorize(options, handleAccessToken)
Authorize against the Strava V3 API and return the Strava access token via a callback.

**Kind**: global function  

| Param | Type | Description |
| --- | --- | --- |
| options | <code>Object</code> |  |
| options.clientId | <code>string</code> | Strava client ID. |
| options.clientSecret | <code>string</code> | Strava client secret. |
| options.scope | <code>string</code> | "write", "view_private", or the empty string. |
| options.httpPort | <code>number</code> | Local port used for the Strava redirect with the Strava auth code. |
| handleAccessToken | <code>function</code> | Callback that is passed (error, accessToken). |

## License

ISC

---
_Source: https://npm.io/package/strava-v3-cli-authenticator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
