# ssif-api

> A self sovereign identity framework API

Latest version **0.2.9** (published 2018-09-17) · Apache-2.0 license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.9 |
| Published | 2018-09-17 |
| First published | 2018-05-20 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=8.9.4 |
| Dependencies | 10 |
| Unpacked size | 118.8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | yes |
| Author | SSIF |
| Maintainers | jnr101 |

## Links

- npm: https://www.npmjs.com/package/ssif-api
- npm.io page: https://npm.io/package/ssif-api

## Dependencies (10)

- [uuid](https://npm.io/package/uuid.md) ^3.2.1
- [web3](https://npm.io/package/web3.md) ^1.0.0-beta.34
- [hdkey](https://npm.io/package/hdkey.md) ^0.8.0
- [jsonld](https://npm.io/package/jsonld.md) ^0.4.12
- [node-cache](https://npm.io/package/node-cache.md) ^4.2.0
- [ethereumjs-tx](https://npm.io/package/ethereumjs-tx.md) ^1.3.4
- [sleep-promise](https://npm.io/package/sleep-promise.md) ^6.0.0
- [bitcore-message](https://npm.io/package/bitcore-message.md) ^1.0.4
- [replace-in-file](https://npm.io/package/replace-in-file.md) ^3.4.0
- [jsonld-signatures](https://npm.io/package/jsonld-signatures.md) ^1.2.1

## Recent versions

- 0.2.9 (latest) — 2018-09-17
- 0.2.8 — 2018-07-16
- 0.2.7 — 2018-07-13
- 0.2.6 — 2018-07-13
- 0.2.5 — 2018-07-13
- 0.2.4 — 2018-07-11
- 0.2.3 — 2018-07-10
- 0.2.2 — 2018-07-10
- 0.2.1 — 2018-07-06
- 0.2.0 — 2018-06-20
- 0.1.9 — 2018-06-13
- 0.1.8 — 2018-06-09
- 0.1.7 — 2018-05-30
- 0.1.6 — 2018-05-29
- 0.1.5 — 2018-05-22
- … 3 more at https://npm.io/package/ssif-api/versions

## README

# Usage

Self Sovereign Identity Framework (SSIF) API
The API is available as npm package <https://www.npmjs.com/package/ssif-api> and can be included in nodejs or javascript and retrieved using npm install. Typescript is used and propagated but not mandatory. The SsifApi manages connection with the claims registry (ERC780 alike contract on Rinkeby) and manages the open sessions that must exist to connect the users ID-App and the web service. The API does not offer direct gateway functionality, but function input/output can be mapped almost one on one on e.g. express or angular framework or other existing webserver framework functionality. See the example below. The idea is that the webserver has access to the necessary data and e.g. knows if the user in question is allready onboarded (use startSession) or needs to exchange key material because it is the first contact (use StartSessionFirstContact)

It is used in both Attestation Issuer (AI) and the Relying Party (RP)

![SsifApi overview](https://github.com/rabobadger/ssif-api/blob/master/docs/SsifApi-Overview.png "SsifApi overview")

## Prerequisites

The software runs on nodejs with typescript.

## Available functions

### constructor SsifApi (ethereumProvider, contractAddress, [privateKey, [config]])

Initialize the API with location and access data to the ERC780 contract / address

### static generateSessionId ()

A static function that can be used to generate a sessionId (which is a UUID)

### addTrustEcdsaKoblitzSignature2016 (key)

set trust for a key this type of attestation (used in the KvK use case)

### addTrustSSIFEthereumHash2017 (contract)

set trust for a contract of this type of attestation (legacy, used in the old rabo AI)

### addTrustSsifErc780Hash2018 (issuer)

set trust for an issuer of this type of attestation (ERC780)

### startSessionAutonomous (ssifCreateRequest)

When a session is started 'remote' i.e. not via the website hosted on this webserver, we do not have a sessionID and can not interact via QR-code with a users ID-App. All functions are therefor executed 'autonomously'. We use this function for the initial onboarding of a user in the Id-App, so the Id-App calls this function directly and (if authenticated), will receive a selection of attestations.

### startSessionFirstContact (sessionId, ssifCreateRequest)

Use this function to start a session for a first encounter with this user and this attestor

### startSession (sessionId, ssifCreateRequest)

Use this function to start a session in all other cases

### getSession (sessionId)

offer this as a webservice 'get' endpoint

### postSession (sessionId)

offer this as a webservice 'post' endpoint

## Parameters

WIP

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