Catalog npm
PACKAGE EXPLORERView in registry

3id-test-helper

npm

Generate 3IDs and signers for testing

Versions collected6
Direct dependencies22From release 1.0.5
Last observed20 Oct, 19:46 UTC

README

Current package documentation

3id Test Helper

A library to generate DIDs and sign Json Web Tokens (JWTs). This library is meant for running tests so that you do not need to log in to your wallet, connect to 3box and then sign JWTs.

Install

Using npm:

$ npm install 3id-test-helper

API

Create the class

const DidHelper = require('3id-test-helper')
const IPFS = require('ipfs')

const ipfs = await IPFS.create()
const testHelper = new DidHelper(ipfs)

Generate DIDs

const accounts = await testHelper.generateAccounts()

When you generate accounts, you create random Ethereum private keys which are used to generate your DIDs.

You can get those private keys and hardcode them in your tests so you can reuse the same DIDs.

const privateKeys = testHelper.getPrivateKeys()
const reusedDIDs = testHelper.generateAccounts(privateKeys)

Signing Json Web Tokens (JWTs)

Important: The did you pass in must have been generated by the class. When the class generates the DIDs, it creates a signer for JWTs.

const jwt = await testHelper.createJWTFromDID(did, payload)

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 6

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.5Registry latest17 Sept 202022
1.0.424 Jul 202021
1.0.39 Jul 202021
1.0.29 Jul 202021
1.0.19 Jul 202021
1.0.09 Jul 202021

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
clearrainlabs/3id-test-helpers

Shared repository data · GitHub

License detected in repository
Not collected

Repository

PENDING
outpostprotocol/3id-test-helpers

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:46 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:d42d9cdd6b87fb573d8fe1cfb2b862d2f45efa3b6bb314f822edd69d85bb23ce