# @op/api-sdk

> Simple SDK for accessing OP APIs

Latest version **1.1.1** (published 2018-04-27) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @op/api-sdk
pnpm add @op/api-sdk
yarn add @op/api-sdk
bun add @op/api-sdk
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2018-04-27 |
| First published | 2018-01-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 62.6 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 15 |
| Author | OP-Developer |
| Maintainers | op |
| Keywords | OP API, OP-Developer, OPEN OP, OP SDK |

## Links

- npm: https://www.npmjs.com/package/@op/api-sdk
- Repository: https://github.com/op-developer/op-api-javascript-sdk
- Issues: https://github.com/op-developer/op-api-javascript-sdk/issues
- npm.io page: https://npm.io/package/@op/api-sdk

## Dependencies (3)

- [axios](https://npm.io/package/axios.md) ^0.17.1
- [@types/axios](https://npm.io/package/@types/axios.md) ^0.14.0
- [object-assign-deep](https://npm.io/package/object-assign-deep.md) ^0.3.1

## Recent versions

- 1.1.1 (latest) — 2018-04-27
- 1.1.0 — 2018-01-31
- 1.0.2 — 2018-01-29
- 1.0.1 — 2018-01-29
- 1.0.0 — 2018-01-29

## README

# op-api-javascript-sdk

[![Build Status](https://travis-ci.org/op-developer/op-api-javascript-sdk.svg?branch=master)](https://travis-ci.org/op-developer/op-api-javascript-sdk)

## Description

    Simple universal SDK for easy consumption of OP APIs.

## Installation

    npm install @op/api-sdk

## Usage

    import SDK from "@op/api-sdk";

    const options = {
        headers: {
            'x-api-key': 'your-api-key',
        }
    }

    const client = new SDK.Client(options)

See [requests](https://op-developer.fi/docs/#user-content-requests) for required headers.

You can set request options for client instance, and also for each request function call, which is useful because you can then use global instance of SDK client, with globally defined x-api-key, but still give separate x-authorization header for each user:

    const userOptions = {
        headers: {
            'x-authorization': userSession.getAuthorizationKey({bank: "OP"})
        }
    }

    const accounts = await client.getAllAccounts(userOptions);

For further reading, please see our API [documentation](https://op-developer.fi/docs/)


## Developing

### Running tests
- register at https://op-developer.fi/developers/register
- create an app that has access to all sandbox products (Mobility, Banking, etc)
- run tests with ```X_API_KEY=<your api key> npm run test```

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