Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nextcloud-libraries/notify_push-client

A javascript client for notify_push events
https://github.com/nextcloud-libraries/notify_push-client

Last synced: about 18 hours ago
JSON representation

A javascript client for notify_push events

Awesome Lists containing this project

README

        

# @nextcloud/notify_push

[![REUSE status](https://api.reuse.software/badge/github.com/nextcloud-libraries/notify_push-client)](https://api.reuse.software/info/github.com/nextcloud-libraries/notify_push-client)
[![npm](https://img.shields.io/npm/v/@nextcloud/notify_push.svg)](https://www.npmjs.com/package/@nextcloud/notify_push)

A javascript client for notify_push events for Nextcloud apps.

## Installation

```sh
npm i @nextcloud/notify_push
```

## Usage

```js
import { listen } from '@nextcloud/notify_push'

// Using pre_auth request for web apps
listen('notify_file', () => {
console.log('A File has been changed')
})

// Using credentials for clients
listen('notify_file', () => {
console.log('A File has been changed')
}, {
credentials: {
username: 'alice',
password: 'app-password',
},
})
```