Created
October 31, 2018 09:55
-
-
Save jsierles/20bec9131975f6dab3aa61c9c62ab3d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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