# depro-sdk

> dePro SDK

Latest version **0.0.2-beta** (published 2022-05-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install depro-sdk
pnpm add depro-sdk
yarn add depro-sdk
bun add depro-sdk
```

## 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.0.2-beta |
| Published | 2022-05-02 |
| First published | 2022-04-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 97.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | zeemzo |

## Links

- npm: https://www.npmjs.com/package/depro-sdk
- Repository: https://github.com/Niftron/depro-sdk
- Homepage: https://github.com/Niftron/depro-sdk#readme
- Issues: https://github.com/Niftron/depro-sdk/issues
- npm.io page: https://npm.io/package/depro-sdk

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.24.0
- [niftron-client-sdk](https://npm.io/package/niftron-client-sdk.md) 0.0.25

## Recent versions

- 0.0.2-beta (latest) — 2022-05-02
- 0.0.1-beta — 2022-04-24

## README

# depro-sdk

DePro SDK allows developers to integrate DePro onto their web apps and start issuing and claiming credentials

## Getting Started

Install the dePro sdk to your nodejs application.

```
npm install --save depro-sdk

```

## Configure Depro SDK

Configure the Depro sdk using your key

```typescript
import { DeproConfig, DEPRO } from "depro-sdk";

const deproConfig: DeproConfig = {
  key: "--------- Key -----------",
};

const depro: DEPRO = new DEPRO(deproConfig);

depro.initialize();
```

## Creating a DePro Profile

DePro needs alias,password,type and email when registering. Here the user type will be PROFILE and CREDENTIALPROVIDER

```typescript
const data = {
  alias: alias,
  password: password,
  type: UserType,
  email: email,
};

await DEPRO.auth.register(data);
```

## Niftron Login

pass the secretKey of the user

```typescript
const secretKey = "";

await DEPRO.auth.niftronLogin(secretKey);
```

## Updating the the profile's details

The profileType will be RESUME or PRODUCT

```typescript
const data = {
  files: files,
  county: string,
  phoneNumber: string,
  profileType: profileType,
  publicKey: string,
  token: string,
};

await DEPRO.profile.addProfileData(data);
```

## Updating the the Credential Provider's details

```typescript
const data = {
  files: files,
  county: string,
  phoneNumber: string,
  name: string,
  city: string,
  publicKey: string,
  token: string,
};

await DEPRO.credentialProvider.addCredentialProviderData(data);
```

## Issuing Credentials

The receiverType will be RESUME or PRODUCT

```typescript
const data = {
  email: string,
  secretKey: string,
  publicKey: string,
  blockchainValue: string,
  isClaimable: boolean,
  receiverType: receiverType,
  token: token,
  imageFile: imageFile,
  latestIpfsUrl: {
    ipfsUrl: string,
    timestamp: Date.now(),
  },
};

await DEPRO.credentialProvider.issueCredential(data);
```

## Retrieving Credential

The uniqueId of the credential

```typescript
await DEPRO.profile.retrieveCredential(uniqueId);
```

## Claiming Credentials

```typescript
const data = {
  secretKey:string,
  publicKey:string,
  senderPublicKey:string,
  blockchainValue:string,
  token:string,
  latestIpfsUrl:string
  itemName:string,
  description:string
  uniqueId:string,

}

await DEPRO.profile.claimCredential(data);

```

## Log out

```typescript
const data = {
  secretKey:string,
  publicKey:string,
  senderPublicKey:string,
  blockchainValue:string,
  token:string,
  latestIpfsUrl:string
  itemName:string,
  description:string
  uniqueId:string,

}

await DEPRO.auth.niftronLogOut();

```

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