https://github.com/d-koppenhagen/webfinger
A webfinger client written in TypeScript
https://github.com/d-koppenhagen/webfinger
client identity javascript library typescript webfinger
Last synced: about 1 year ago
JSON representation
A webfinger client written in TypeScript
- Host: GitHub
- URL: https://github.com/d-koppenhagen/webfinger
- Owner: d-koppenhagen
- License: lgpl-3.0
- Created: 2017-06-13T19:43:04.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-07-15T23:20:31.000Z (almost 6 years ago)
- Last Synced: 2025-02-10T00:25:30.672Z (over 1 year ago)
- Topics: client, identity, javascript, library, typescript, webfinger
- Language: TypeScript
- Size: 1.13 MB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# webfinger-client
[![NPM version][npm-image]][npm-url]
A webfinger client that runs both in the browser and in node.js.
The Client is based on Nick Jennings library [webfinger.js](https://github.com/silverbucket/webfinger.js) but has been rewritten in TypeScript.
## Demo
Check out the Demo at GitHub Pages: [https://d-koppenhagen.github.io/webfinger/](https://d-koppenhagen.github.io/webfinger/)
## Features
* defaults to TLS only
* optional URI fallback (for older services which use `host-meta` or `host-meta.json` URI endpoints)
* optional support for [WebFist](http://webfist.org)
## Demo
clone this repository, run `npm install` and finally `npm start`
## Install
Install the client as a dependency:
```bash
npm install --save webfinger-client
```
## Usage
### Import
You have to import the module before using it:
```typescript
import { WebFinger } from 'webfinger';
```
### Use
```typescript
let webfinger = new WebFinger({
webfistFallback: true, // defaults to false
tlsOnly: true, // defaults to true
uriFallback: false, // defaults to false
requestTimeout: 10000, // defaults to 10000
});
webfinger.lookup('alice@example.org', function (err, p) {
if (err) {
console.log('error: ', err.message);
} else {
console.log(p);
}
});
// example output:
// {
// idx: {
// properties: {
// name: "Alice Henderson"
// },
// links: {
// avatar: [{ href: '' }],
// blog: [{ href: '' }],
// vcard: [href: '