---
title: "Migrate from Ably to NoLag"
description: A practical guide to moving a realtime app from Ably to NoLag, with a concept map and before-and-after code for channels, publishing, presence, and history.
excerpt: "Ably and NoLag are both realtime pub/sub platforms with presence. Migrating is mostly a concept rename. Here is the mapping and the code, side by side."
date: '2026-07-31'
readTime: 6 min read
category: Migration Guide
---

Ably is a mature realtime platform with rich delivery semantics. NoLag shares the same pub/sub foundation and presence model, so moving across is mostly a matter of renaming a few concepts. This guide maps Ably onto NoLag and shows the same flow in both.

## Why teams move

NoLag keeps the realtime transport you rely on and adds:

- **Blueprint SDKs** for chat, notifications, dashboards, tracking, and more.
- **A coordination layer for AI agents**: dispatch, share state, observe, and approve, on the same platform as your app features.
- One place for human-facing and agent-facing realtime.

## Concept map

| Ably | NoLag |
| --- | --- |
| API key / token auth | Actor access tokens |
| Channel | Room + topic |
| `channel.subscribe('event', cb)` | `room.on('topic', cb)` |
| `channel.publish('event', data)` | `room.emit('topic', data)` |
| `channel.presence` | Presence (per room) |
| History | Message logging and replay |

## Before: Ably

```js
import * as Ably from 'ably'

const ably = new Ably.Realtime('API_KEY')
const channel = ably.channels.get('chat')

channel.subscribe('message', (msg) => {
  console.log('Received:', msg.data)
})

channel.publish('message', { text: 'Hello!' })
```

## After: NoLag

```ts
import { NoLag } from '@nolag/js-sdk'

const client = NoLag('your_access_token')
await client.connect()

const room = client.setApp('chat').setRoom('general')
room.subscribe('message')

room.on('message', (data) => {
  console.log('Received:', data)
})

room.emit('message', { text: 'Hello!' })
```

## Presence and history

Ably presence maps to NoLag [presence](/docs/concepts/presence), tracked per room with join and leave events and a live member list. If you use Ably history to fetch missed messages, NoLag covers that with [message logging and replay](/docs/concepts/qos), so a client that reconnects can catch up.

## Delivery guarantees

Ably is known for its delivery semantics. NoLag offers [quality-of-service levels](/docs/concepts/qos) 0, 1, and 2 (at most once, at least once, exactly once) so you choose the guarantee per message rather than paying for the strongest everywhere.

## Next steps

- Start with the [5-minute quick start](/docs/getting-started).
- Read the deeper [NoLag vs Ably](/compare/ably) comparison.
- Explore the [high-level SDKs](/docs/high-level-sdks) if you would rather not rebuild chat or dashboards by hand.
