How to use the ably.Rest function in ably

To help you get started, we’ve selected a few ably examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / ably / ably-tests.ts View on Github external
import * as Ably from 'ably';

declare var console: { log(message: any): void };

const ApiKey = 'appId.keyId:secret';
const client = new Ably.Realtime(ApiKey);
const restClient = new Ably.Rest(ApiKey);

// Connection
// Successful connection:

client.connection.on('connected', () => {
  // successful connection
});

// Failed connection:

client.connection.on('failed', () => {
  //  failed connection
});


// Subscribing to a channel

ably

Realtime client library for Ably, the realtime messaging service

Apache-2.0
Latest version published 2 days ago

Package Health Score

87 / 100
Full package analysis