Skip to content

Commit 88c7182

Browse files
authored
Merge pull request #2126 from ably/cdn
Readme tweak: re-add CDN
2 parents 15ea48c + 284f330 commit 88c7182

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,10 @@ The JavaScript SDK is available as an [NPM module](https://www.npmjs.com/package
5959
npm install ably
6060
```
6161

62-
Run the following to instantiate a client:
62+
You can also source it directly in your HTML. (This url will point to the latest version of v2 of the SDK, the current major version, avoiding breaking changes per semver)
6363

64-
```javascript
65-
import * as Ably from 'ably';
66-
const realtime = new Ably.Realtime({ key: apiKey });
64+
```html
65+
<script src="https://cdn.ably.com/lib/ably.min-2.js"></script>
6766
```
6867

6968
## Usage
@@ -72,6 +71,7 @@ The following code connects to Ably's realtime messaging service, subscribes to
7271

7372
```javascript
7473
// Initialize Ably Realtime client
74+
// (for the REST client use new Ably.Rest({...}) instead)
7575
const realtimeClient = new Ably.Realtime({ key: 'your-ably-api-key', clientId: 'me' });
7676

7777
// Wait for connection to be established

0 commit comments

Comments
 (0)