# p1-harpocrates-sdk

> p1 harpocrates sdk

Latest version **2.0.2** (published 2021-04-19) · private license · 0 weekly downloads

## Install

```sh
npm install p1-harpocrates-sdk
pnpm add p1-harpocrates-sdk
yarn add p1-harpocrates-sdk
bun add p1-harpocrates-sdk
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2021-04-19 |
| First published | 2020-04-27 |
| Weekly downloads | 0 |
| License | private |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 294.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | privacyone |
| Maintainers | privacyone |

## Links

- npm: https://www.npmjs.com/package/p1-harpocrates-sdk
- npm.io page: https://npm.io/package/p1-harpocrates-sdk

## Recent versions

- 2.0.2 (latest) — 2021-04-19
- 2.0.1 — 2021-04-14
- 1.0.12 — 2020-08-22
- 1.0.0 — 2020-08-22
- 1.0.11 — 2020-05-24
- 1.0.10 — 2020-04-27
- 1.0.9 — 2020-04-27

## README

# P1 harpocrates SDK

## keychain sdk example code

```
const SDK = require('p1-harpocrates-sdk')

const DOMAIN_KEYCHAIN = "keychain_host_url";
const DOMAIN_CERBERUS = "cerberus_host_url";
const KEYCHAIN_API_KEY = "AABBEECC558899FFF776655334422111"; //32 bytes
const CERBERUS_USERNAME = "ldar";
const CERBERUS_PWD = "ldar_password";

console.log("Starting testing");

const keychain = new SDK.Keychain(DOMAIN_KEYCHAIN, 8090, KEYCHAIN_API_KEY, 30);

keychain
.authenticate(DOMAIN_CERBERUS, 8093, CERBERUS_USERNAME, CERBERUS_PWD)
.then(() => {
    console.log("authenticate done");
})
.catch(err => {
    console.log("got error", err);
});

// add user
keychain.createUser("test").then(() => {
    console.log("user created");
});

// soft delete user
keychain.deleteUser("test", false).then(() => {
    console.log("user soft deleted");
});

// hard delete user
keychain.deleteUser("test", true).then(() => {
    console.log("user hard deleted");
});

// set user consent
keychain.setConsent("aaa", "image", true).then(() => {
}).catch((error) =>{
    console.log("got error", err);
});

// set user restriction
keychain.setRestriction("aaa", "image", true).then(() => {
}).catch((error) =>{
    console.log("got error", err);
});

// set deletion
keychain.deletion("aaa", "image").then(() => {
}).catch((error) =>{
    console.log("got error", err);
});

// encryption and decryption

// encryptString
keychain.encryptString("aaa", "voice", "Need to be encrypted").then((encryptedBytes) => {
    keychain.decryptToString("aaa", "voice", encryptedBytes).then(decryptString => {
        console.log(decryptString);
    });
});

// Number, Boolean, Date can also be encryt

```

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