Skip to main content

Real-time debugging

Last updated 10/02/2026
Note

The SDK Debug mode is only for debugging during integration. Never use it in the production environment.

During SDK integration, you can debug in real time by viewing the SDK logs in the IDE console or by using the Debug feature of AE.

1. Print SDK logs​

ThinkingData.enableLog(true);

2. Enable Debug mode​

Enabling Debug mode takes the following two steps:

  1. Use DebugMode

The following sample code uses DebugMode:

/*
DebugMode: Data is reported one record at a time. Problems are reported to the user through logs and exceptions. Not recommended for the production environment
*/
let teSDK = ThinkingData.initWithDebugMode('appId', 'serverUrl', {
dryRun: false, // report data to TE or not
deviceId: "123456789"
});

let trackEvent = {
accountId: '2222',
distinctId: '1111',
event: 'test_event',
time: new Date(),
ip: '202.38.64.1',
properties: {
prop_double: 134.1,
},
callback(e) {
if (e) {
console.log(e);
}
}
};

teSDK.track(trackEvent)
  1. Add a Debug device in the AE backend

To prevent Debug mode from going live in the production environment, only specified devices can enable Debug mode. A device can enable Debug mode only if Debug mode is enabled on the client and the device ID has been added on the Data > Tracking > Debugger page in AE. To add a device, click Add test device in the upper-right corner of the page, click New device in the Select device drawer, and enter the device ID.

Debug mode may affect data collection quality and App stability. Use it only to verify data during integration, and don't use it in the production environment.

Was this page helpful?