Skip to content

XPRNetwork/wharfkit-plugin-webauth

Repository files navigation

@proton/wharfkit-plugin-webauth

A Session Kit wallet plugin for the WebAuth wallet.

Usage

Include this wallet plugin while initializing the SessionKit.

Mobile device and browser authentications are supported

NOTE: This wallet plugin will only work with the SessionKit and requires a browser-based environment.

import {WalletPluginWebAuth} from '@proton/wharfkit-plugin-webauth'

const kit = new SessionKit({
    // ... your other options
    walletPlugins: [new WalletPluginWebAuth()],
})

Main and test networks are supported

import {WalletPluginWebAuth} from '@proton/wharfkit-plugin-webauth'

const kit = new SessionKit({
    // ... your other options
    walletPlugins: [
        new WalletPluginWebAuth({
            scheme: 'proton-dev' // 'esr' | 'proton' | 'proton-dev'
        }),
    ],
    })

Custom buoy url and websocket class are supported.

import WebSocket from 'isomorphic-ws'
import {WalletPluginWebAuth} from '@proton/wharfkit-plugin-webauth'

const kit = new SessionKit({
    // ... your other options
    walletPlugins: [
        new WalletPluginWebAuth({
            buoyUrl: 'https://cb.anchor.link',
            buoyWs: Websocket,
        }),
    ],
    })

Example

You can find working example in examples folder

Developing

You need Make, node.js and yarn installed.

Clone the repository and run make to checkout all dependencies and build the project. See the Makefile for other useful targets. Before submitting a pull request make sure to run make lint.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published