npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

wtf-lib

v2.0.5

Published

wtf-lib is a JavaScript library for interacting with the [WTF protocol](https://github.com/opscientia/DIDJWT).

Downloads

50

Readme

wtf-lib

wtf-lib is a JavaScript library for interacting with the WTF protocol.

The WTF protocol allows identities from various web services to be associated with crypto addresses. For example, I can use the protocol to associate my gmail address with my Ethereum address. Currently, a user can associate their various web identities with their address through Holonym.

Installation

npm install wtf-lib

Usage

import wtf from 'wtf-lib';

(All of the below queries to WTF require the relevant users to be registered on WTF. One cannot use WTF to retrieve information about unregistered users.)

It is recommended that projects using wtf-lib use their own JSON RPC providers to access blockchain networks. By default, wtf-lib uses ethers default providers, but these can be slow. Use setProviderURL to specify the http url of each of your providers. You can specify different providers for different networks, or you can specify one network. If you specify multiple providers, wtf-lib will use each endpoint only for its specified network. If you specify only one provider, wtf-lib will query that provider for all networks supported by WTF protocol.

// Tell wtf-lib to use separate providers for Ethereum and Polygon.
wtf.setProviderURL({'ethereum', 'https://provider.io', 'polygon': 'https://otherprovider.io'})
// Tell wtf-lib to use one provider for all networks.
wtf.setProviderURL({'default': 'https://provider.io'})

Get a user's identity associated with a particular service. In the following example, we query WTF smart contracts for the google identity associated with userAddress.

const userAddress = '0x1234567891234567891234567891234567891234';
const gmail = await wtf.credentialsForAddress(userAddress, 'google');

We can also get a user's crypto address from their web identity. Below, we get the user's crypto address.

const userGmail = '[email protected]';
const address = await wtf.addressForCredentials(userGmail, 'google');

We can get a Holonym user's name and bio.

const userAddress = '0x1234567891234567891234567891234567891234';
const name = await wtf.nameForAddress(userAddress);
const bio = await wtf.bioForAddress(userAddress);

To get all info associated with a user's address, use getHolo.

const holo = await wtf.getHolo(userAddress);
const userName = holo['ethereum']['name']
const userOrcid = holo['ethereum']['orcid']

We might want to see which users are registered on WTF. Get an object containing all registered addresses on all networks with getAllUserAddresses.

const addresses = await wtf.getAllUserAddresses();

Contribute

To setup your environment to contribute, first clone this repository.

git clone https://github.com/opscientia/wtf-api.git

Change directory into wtf-api.

cd wtf-api

This package was developed with Node v16.14.2. If you are using nvm, run:

nvm use

Install dependencies.

npm install

Make sure everything works by running the tests.

npm run test