1.2.1 • Published 1 year ago

@vk-io/streaming v1.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
1 year ago

VK-IO Streaming

VK-IO Streaming API - Separated module for receiving data with Streaming API ⚙️

📦 Installation

Node.js 12.20.0 or newer is required

  • Using npm (recommended)
    npm i @vk-io/streaming
  • Using Yarn
    yarn add @vk-io/streaming
  • Using pnpm
    pnpm add @vk-io/streaming

Example usage

import { VK } from 'vk-io';

import { StreamingAPI } from '@vk-io/streaming';

const vk = new VK({
	token: process.env.TOKEN
});

const streaming = new StreamingAPI({
	api: vk.api,
	updates: vk.updates
});

vk.updates.on('publication', (context) => {
	console.log('Streaming context', context);
});

async function run() {
	await streaming.startWebSocket();

	await streaming.addRule({
		tag: 'halloween',
		value: 'тыква'
	});
}

run().catch(console.error);
1.2.1

1 year ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

4 years ago

0.0.0-alpha.1

5 years ago