1.0.4 • Published 7 months ago

@whoiswhere/sdk v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago

@whoiswhere/SDK

Overview

@whoiswhere/SDK is a real-time user and application monitoring package designed to be integrated into web applications. Easily track which users are currently connected to which applications using WebSocket technology.

Note: This SDK is part of the @whoiswhere suite, which will later include @whoiswhere/server.

Installation

To install the package, simply run:

npm install @whoiswhere/sdk

Usage

To use the SDK, you need to import it into your web application and call the connectWebSocket function:

Importing

import connectWebSocket from '@whoiswhere/sdk';

Initialize WebSocket Connection

To initialize a WebSocket connection, use the connectWebSocket function.

import { useEffect } from 'react';
import connectWebSocket from '@whoiswhere/sdk';

const MyApp = () => {
  useEffect(() => {
    const user = 'userName';
    const appIdentifier = 'YourAppIdentifier';
    const wsHost = 'ws://your-websocket-host';
    connectWebSocket(user, appIdentifier, wsHost);
  }, []);

  return (
    <div>
      {/* Your application */}
    </div>
  );
};

Contributions

Contributions to improve the SDK are welcome. Please make sure to read the contributing guide before making a pull request.

License

MIT

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago