Nearly Perfected Mystique

    @runspace/ataraxia-auth
    TypeScript icon, indicating that this package has built-in type declarations

    0.0.0 • Public • Published

    @runspace/ataraxia-auth

    Ataraxia JWT Auth implementation.

    Example

    import { Network } from 'ataraxia';
    import { TCPTransport, TCPPeerMDNSDiscovery } from 'ataraxia-tcp';
    import { RunSpaceAuth } from '@runspace/ataraxia-auth';
    
    const net = new Network({
        name: 'name-of-your-app-or-network',
        authentication: [
            new RunSpaceAuth("your-secret")
        ]
    });
    
    net.addTransport(new TCPTransport({
        discovery: new TCPPeerMDNSDiscovery()
    }));
    
    net.onNodeAvailable(node => {
        console.log('A new node is available:', node.id);
        node.send('hey', 'there');
    });
    
    net.onMessage(msg => {
        console.log(msg);
    });
    
    net.start()
        .then(console.log)
        .catch(console.error);

    see in src/example/index.ts

    Keywords

    none

    Install

    npm i @runspace/ataraxia-auth

    DownloadsWeekly Downloads

    1

    Version

    0.0.0

    License

    GPL-3.0

    Unpacked Size

    51 kB

    Total Files

    28

    Last publish

    Collaborators

    • 0x77