@whoiswhere/sdk
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

@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

Readme

Keywords

none

Package Sidebar

Install

npm i @whoiswhere/sdk

Weekly Downloads

0

Version

1.0.4

License

ISC

Unpacked Size

3.16 kB

Total Files

4

Last publish

Collaborators

  • isee_dev