# stromer-api

> Access the API of the Stromer electric bike.

Latest version **0.1.4** (published 2018-10-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install stromer-api
pnpm add stromer-api
yarn add stromer-api
bun add stromer-api
```

## 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.1.4 |
| Published | 2018-10-14 |
| First published | 2018-10-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 147.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 20 |
| Author | Tim Broddin |
| Maintainers | broddintim |

## Links

- npm: https://www.npmjs.com/package/stromer-api
- Repository: https://github.com/timbroddin/stromer-api
- Homepage: https://github.com/timbroddin/stromer-api#readme
- Issues: https://github.com/timbroddin/stromer-api/issues
- npm.io page: https://npm.io/package/stromer-api

## Dependencies (8)

- [qs](https://npm.io/package/qs.md) ^6.5.2
- [moment](https://npm.io/package/moment.md) ^2.22.2
- [cheerio](https://npm.io/package/cheerio.md) ^1.0.0-rc.2
- [request](https://npm.io/package/request.md) ^2.88.0
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.1.2
- [@babel/polyfill](https://npm.io/package/@babel/polyfill.md) ^7.0.0
- [@babel/register](https://npm.io/package/@babel/register.md) ^7.0.0
- [request-promise](https://npm.io/package/request-promise.md) ^4.2.2

## Recent versions

- 0.1.4 (latest) — 2018-10-14
- 0.1.3 — 2018-10-12
- 0.1.2 — 2018-10-12
- 0.1.1 — 2018-10-12
- 0.1.0 — 2018-10-12

## README

# Stromer API for Node JS

This NPM package provides a wrapper for the [Stromer e-bike API](https://www.stromerbike.com/fr_BE.html). By using this package you can get your bike's status, position and much more.

## Installation

`yarn add stromer-api`

or

`npm install stromer-api --save`

## Usage

    const Stromer = require('stromer-api');

    const api = new Stromer({
    username: "xxxxx",
    password: "xxxxxx",
    client_id: "xxxxxxx",
    client_secret: "xxxxxxx"
    });

    api.bike.state.get().then(state => console.log(state));

### Client id & secret

I can not share the Stromer client id & secret. However, it should be pretty easy to obtain them by using a tool like [mitmproxy](https://mitmproxy.org/) while using an official Stromer app.

## Methods

Once you've initiated the API, it's pretty easy to get all the info you need. All methods are async, so you can either use `async await` or use promises.

Let's say you've initiated the API like I did above:

| Method                                | Returns                                                              |
| ------------------------------------- | -------------------------------------------------------------------- |
| api.bike.state.get(cached = false)    | The state of your bike (battery info, FW version, temperatures, ...) |
| api.bike.position.get(cached = false)    | The position of your bike                                            |
| api.bike.serviceInfo.get()            | Technical details of all your bike parts (not in official app)       |
| api.bike.settings.get()               | Get all settings                                                     |
| api.bike.settings.getMainSettings()   | Get main settings (auto lock, ...)                                   |
| api.bike.settings.getSensorSettings() | Get torque and brake sensor settings                                 |
| api.bike.settings.getTuningSettings() | Get tuning settings for preset 2                                     |
| api.bike.settings.set(data)           | Change a setting, pass data as an object                             |
| api.bike.light.set(mode = flash)      | Flash the front light                                                |
| api.bike.lock()                       | Lock your bike                                                       |
| api.bike.unlock()                     | Unlock your bike                                                     |

## Thanks

Many thanks to merstro on [StromerForum.nl](http://stromerforum.nl) for the initial Python code!

## Disclaimer

Use at your own risk!

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