import { init, Ditto, TransportConfig } from '@dittolive/ditto'
await init()
const ditto = new Ditto({
type: "onlinePlayground",
appID: "REPLACE_ME_WITH_YOUR_APP_ID",
token: "REPLACE_ME_WITH_YOUR_PLAYGROUND_TOKEN",
customAuthURL: "REPLACE_ME_WITH_YOUR_AUTH_URL",
enableDittoCloudSync: false, // This is required to be set to false to use the correct URLs
})
ditto.updateTransportConfig((config: TransportConfig): void => {
config.connect.websocketURLs.push(
'wss://REPLACE_ME_WITH_YOUR_WEBSOCKET_URL'
)
})
// Disable DQL strict mode so that collection definitions are not required in DQL queries
await ditto.store.execute("ALTER SYSTEM SET DQL_STRICT_MODE = false")
ditto.startSync()