# apollo-pusher-link

> pusher link for apollo client

Latest version **0.1.1** (published 2022-11-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install apollo-pusher-link
pnpm add apollo-pusher-link
yarn add apollo-pusher-link
bun add apollo-pusher-link
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2022-11-12 |
| First published | 2022-11-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | yura m |
| Maintainers | yurich.rb |
| Keywords | apollo, pusher |

## Links

- npm: https://www.npmjs.com/package/apollo-pusher-link
- Repository: https://github.com/bronko-rb/apollo-pusher-link
- Homepage: https://github.com/bronko-rb/apollo-pusher-link#readme
- Issues: https://github.com/bronko-rb/apollo-pusher-link/issues
- npm.io page: https://npm.io/package/apollo-pusher-link

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2022-11-12
- 0.1.0 — 2022-11-06

## README

# apollo-pusher-link

## Installation

```bash
yarn add apollo-pusher-link
# or
npm i apollo-pusher-link
```

## Configuration

```ts
import { from } from '@apollo/client'
import Pusher from 'pusher-js'

const pusherClient = new Pusher(APP_KEY, {
  cluster: APP_CLUSTER,
  authEndpoint: AUTH_ENDPOINT,
})

const pusherLink = new PusherLink({ pusher: pusherClient })

const link = from([
  pusherLink,
  // ... other links
])

const client = new ApolloClient({
  link,
  // Provide required constructor fields
  // uri:
  // cache:
})
```

## Usage

```ts
const subscription = client.subscribe({
  variables: { /*variables*/ },
  query: gql`
    subscription someSubscription {
      someSubscription {
        id
      }
    }
`,
})

const unsubscribe = subscription.subscribe({ next: ({ data, errors }) => {
  // Do something
}})

// unsubscribe() /*run unsubscribe when needed*/ 
```

## License

[MIT](https://choosealicense.com/licenses/mit/)

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