JSPM

  • Created
  • Published
  • Downloads 15
  • Score
    100M100P100Q77095F
  • License Apache-2.0

Affinidi TDK typescript client for Affinidi CREDENTIAL VERIFICATION

Package Exports

  • @affinidi-tdk/credential-verification-client
  • @affinidi-tdk/credential-verification-client/dist/esm/index.js
  • @affinidi-tdk/credential-verification-client/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@affinidi-tdk/credential-verification-client) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@affinidi-tdk/credential-verification-client@1.34.0

This generator creates TypeScript/JavaScript client that utilizes axios. The generated Node module can be used in the following environments:

Environment

  • Node.js
  • Webpack
  • Browserify

Language level

  • ES5 - you must have a Promises/A+ library installed
  • ES6

Module system

  • CommonJS
  • ES6 module system

It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via package.json. (Reference)

Building

To build and compile the typescript sources to javascript use:

npm install
npm run build

Publishing

First build the package then run npm publish

Consuming

navigate to the folder of your consuming project and run one of the following commands.

published:

npm install @affinidi-tdk/credential-verification-client@1.34.0 --save

unPublished (not recommended):

npm install PATH_TO_GENERATED_PACKAGE --save

Documentation for API Endpoints

All URIs are relative to https://apse1.api.affinidi.io/ver

Class Method HTTP request Description
DefaultApi verifyCredentials POST /v1/verifier/verify-vcs Verifying VC
DefaultApi verifyPresentation POST /v1/verifier/verify-vp Verifying VP

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

UserTokenAuth

  • Type: API key
  • API key parameter name: authorization
  • Location: HTTP header

ProjectTokenAuth

  • Type: API key
  • API key parameter name: authorization
  • Location: HTTP header

Obtaining auth token

💡 To create personal access token (PAT), use Affinidi CLI's create-token command.

Login to your Affinidi Vault.

affinidi login

Check for command details if you want to set optional passphrase and keyId:

affinidi token --help

Create PAT:

affinidi token create-token -n YourTokenName -g -w --no-input

This command will return you variables to initialize AuthProvider as required below.

import {
  SomeClassApi,
  Configuration,
} from '@affinidi-tdk/credential-verification-client'
import { AuthProvider } from '@affinidi-tdk/auth-provider'

const authProvider = new AuthProvider({ tokenId, privateKey, projectId })

const api = new SomeClassApi(
  new Configuration({
    apiKey: authProvider.fetchProjectScopedToken.bind(authProvider),
  }),
)

await api.oneOfMethods()