Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import * as Ably from 'ably'
import getConfig from 'next/config'
const { publicRuntimeConfig } = getConfig()
const config = {
authUrl: publicRuntimeConfig.realtimeAuthUrl,
// setting an Authorization header enables withCredentials,
// needed for our cookie auth to the backend
authHeaders: {
authorization: 'none'
autoConnect: false,
const Realtime = new Ably.Realtime(config)
export default Realtime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.