SDKsReact Native

Debugging

Turn on SDK logging to troubleshoot a blank ad slot in React Native.

The SDK is silent by default — a misconfiguration shows up as an empty space, not an error. Turn on logging to see what's happening.

Enable debug logging

Pass logLevel to Koah.init. It controls how much the SDK writes to the JS console (Metro / your debugger). Levels are KoahLogLevel.NONE (default), ERROR, WARNING, INFO, and DEBUG.

import { Koah, KoahLogLevel, KoahProvider, KoahBrowserModal } from 'koah-react-native'

const koah = Koah.init({
  publisherId: 'YOUR_PUBLISHER_ID',
  logLevel: __DEV__ ? KoahLogLevel.DEBUG : KoahLogLevel.NONE,
})

export default function App() {
  return (
    <KoahProvider client={koah}>
      <YourApp />
      <KoahBrowserModal />
    </KoahProvider>
  )
}

Gate it on __DEV__ so verbose logging never ships in a release build.

What the logs show

With KoahLogLevel.DEBUG you'll see, prefixed with [Koah SDK]:

  • an info line with your init parameters when the SDK starts,
  • a debug line for each impression and event the SDK tracks, and
  • an error — with the HTTP status — when /k/init or an ad request fails.

Successful requests are quiet: a fill or an ordinary no-fill logs nothing at any level. If you see Failed to initialize Koah SDK, check the publisher ID and network reachability. If requests return no-fill on a production key, that's expected — see below.

Testing with a demo key

Real-inventory fill rate is not 100%, so a production key can legitimately return no-fill. In a debug build, the SDK logs a boxed warning pointing at demo keys when this happens. For reliable local testing, use a demo publisher key.

Still not showing an ad?

Work down the debugging checklist — it covers init order, KoahBrowserModal, the optional peer dependencies, and slot sizing.

Was this helpful?