# ms-signalr-client

> packaged version of the Microsoft Javascript SignalR client

Latest version **2.2.7** (published 2017-05-07) · Apache-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install ms-signalr-client
pnpm add ms-signalr-client
yarn add ms-signalr-client
bun add ms-signalr-client
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.2.7 |
| Published | 2017-05-07 |
| First published | 2015-04-23 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+4 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Danny Frencham |
| Maintainers | dfrencham |
| Keywords | signalr |

## Links

- npm: https://www.npmjs.com/package/ms-signalr-client
- Repository: https://github.com/dfrencham/ms-signalr-client
- Issues: https://github.com/dfrencham/ms-signalr-client/issues
- npm.io page: https://npm.io/package/ms-signalr-client

## Dependencies (1)

- [jquery](https://npm.io/package/jquery.md) ^2.2.0

## Recent versions

- 2.2.7 (latest) — 2017-05-07
- 2.2.5 — 2016-07-28
- 2.2.4 — 2016-07-27
- 2.2.3 — 2016-06-16
- 2.2.2 — 2015-04-24
- 2.2.1 — 2015-04-23
- 2.2.0 — 2015-04-23

## README

# ms-signalr-client
## Unofficial package for the SignalR JS Client

This is a package for Microsoft's [ASP.NET SignalR JavaScript Library](https://github.com/SignalR/SignalR/wiki/SignalR-JS-Client).

Current packaged version is **v2.2.2-pre**.

### Usage

Include the library in your page using one of the following methods:

#### ES6 Loader

```
import $ from 'jquery';
import 'ms-signalr-client';
```

#### require JS

```
require('jquery');
require('ms-signalr-client');
```

#### HTML

```
<script src="../node_modules/jquery/dist/jquery.js"></script>
<script src="../jquery.signalR.js"></script>
```

Set up a connection to a signalR host, and Hub. Make sure you update the [address], [port], and [hubname] values to suit your environment.

```
var connection = $.hubConnection('http://[address]:[port]');
var proxy = connection.createHubProxy('[hubname]');

// receives broadcast messages from a hub function, called "broadcastMessage"
proxy.on('broadcastMessage', function(message) {
    console.log(message);
});

// atempt connection, and handle errors
connection.start({ jsonp: true })
.done(function(){ console.log('Now connected, connection ID=' + connection.id); })
.fail(function(){ console.log('Could not connect'); });
}
```

### Tests

To run tests, run the following command:

```
$ npm run test
```

Tests will be run using:

- PhantomJS (headless browser)
- Mocha (test runner)
- Chai (assertion library)

### Version numbering

The build number is a little ahead of the offical jquery.signalr repo. This is due to fixes to this package requiring a package version bump.

### Problems

If you have problems with this package, log them on [the bug tracker](https://github.com/dfrencham/ms-signalr-client/issues). If you have issues with the jquery.signalr library, go to the [SignalR bug tracker](https://github.com/SignalR/SignalR/issues).

### Licence Information

As per the following:

- All client code is Copyright (C) Microsoft Corporation. All rights reserved.

I make no claims on this code, but I have kindly packaged it up for you. :)

---
_Source: https://npm.io/package/ms-signalr-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
