CINXE.COM

<!doctype html> <html lang="en" dir="ltr" class="docs-wrapper plugin-docs plugin-id-default docs-version-current docs-doc-page docs-doc-id-sdks/debugging" data-has-hydrated="false"> <head> <meta charset="UTF-8"> <meta name="generator" content="Docusaurus v3.5.2"> <title data-rh="true">SDK Debugging | Statsig Docs</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:image" content="https://docs.statsig.com/img/docs_meta_q3_2023.png"><meta data-rh="true" name="twitter:image" content="https://docs.statsig.com/img/docs_meta_q3_2023.png"><meta data-rh="true" property="og:url" content="https://docs.statsig.com/sdk/debugging"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="SDK Debugging | Statsig Docs"><meta data-rh="true" name="description" content="Debugging Tools"><meta data-rh="true" property="og:description" content="Debugging Tools"><link data-rh="true" rel="icon" href="/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://docs.statsig.com/sdk/debugging"><link data-rh="true" rel="alternate" href="https://docs.statsig.com/sdk/debugging" hreflang="en"><link data-rh="true" rel="alternate" href="https://docs.statsig.com/sdk/debugging" hreflang="x-default"><link data-rh="true" rel="preconnect" href="https://JOWHDNMZRN-dsn.algolia.net" crossorigin="anonymous"><link rel="search" type="application/opensearchdescription+xml" title="Statsig Docs" href="/opensearch.xml"> <script>!function(e,t,n,a){e[a]=e[a]||[],e[a].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var r=t.getElementsByTagName(n)[0],o=t.createElement(n);o.async=!0,o.src="https://www.googletagmanager.com/gtm.js?id=GTM-NRDCWNF";var c=t.querySelector("[nonce]");c&&o.setAttribute("nonce",c.nonce||c.getAttribute("nonce")),r.parentNode.insertBefore(o,r)}(window,document,"script","dataLayer")</script> <script async defer="defer" src="https://www.googletagmanager.com/gtag/js?id=G-EM5RHE1RHW"></script> <script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","G-EM5RHE1RHW")</script> <script src="https://www.statsig.com/js/single-id.js" onload="setupStatsigSingleId(&#39;docs&#39;)"></script> <script src="https://cdn.jsdelivr.net/npm/@statsig/js-client@3/build/statsig-js-client+session-replay+web-analytics.min.js?apikey=client-XlqSMkAavOmrePNeWfD0fo2cWcjxkZ0cJZz64w7bfHX"></script> <script>window.statsigTier="production"</script> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&amp;display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&amp;display=swap"> <script src="/js/rapidoc-min.js"></script> <script src="https://cdn.koala.live/v1/daniel/sdk.js"></script> <script src="/js/koala.js"></script> <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.min.css" integrity="sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM" crossorigin="anonymous"><link rel="stylesheet" href="/assets/css/styles.e648ac00.css"> <script src="/assets/js/runtime~main.18f979f5.js" defer="defer"></script> <script src="/assets/js/main.0dc075c9.js" defer="defer"></script> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();t(null!==e?e:"light")}(),function(){try{const n=new URLSearchParams(window.location.search).entries();for(var[t,e]of n)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}()</script><div id="__docusaurus"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="/img/logo-new.svg" alt="Statsig" class="themedComponent_mlkZ themedComponent--light_NVdE"><img src="/img/logo_white.svg" alt="Statsig" class="themedComponent_mlkZ themedComponent--dark_xIcU"></div><b class="navbar__title text--truncate"></b></a><div class="navbarSearchContainer_Bca1"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"></span></button></div><div class="navbar__item"><button class="signupCTA CTA" onclick='window.open("https://console.statsig.com","_blank").focus()'>Get Started</button></div></div><div class="navbar__items navbar__items--right"><div class="toggle_vylO colorModeToggle_DEke"><button class="clean-btn toggleButton_gllP toggleButtonDisabled_aARS" type="button" disabled="" title="Switch between dark and light mode (currently light mode)" aria-label="Switch between dark and light mode (currently light mode)" aria-live="polite"><svg viewBox="0 0 24 24" width="24" height="24" class="lightToggleIcon_pyhR"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" class="darkToggleIcon_wfgR"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg></button></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0"><div class="docsWrapper_hBAB"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docRoot_UBD9"><aside class="theme-doc-sidebar-container docSidebarContainer_YfHR"><div class="sidebarViewport_aRkj"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--active">New to Statsig?</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item doc-icon sidebar-icon"><a class="menu__link" tabindex="0" href="/">Overview</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed rocket-icon sidebar-icon"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" tabindex="0" href="/guides/first-feature">Quickstart Guides</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed lightbulb-icon sidebar-icon"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" tabindex="0" href="/understanding-platform">Core Concepts &amp; Setup</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item doc-icon sidebar-icon"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" role="button" aria-expanded="true" tabindex="0" href="/sdks/getting-started">SDKs &amp; Frameworks</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/sdks/getting-started">SDK Overview</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/sdks/client-vs-server">Client vs Server SDKs</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/concepts/user">Passing a User to SDKs</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/client/concepts/initialize">Initializing</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/sdk/debugging">Debugging</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item html-icon sidebar-icon sdk-sidebar-icon"><a class="menu__link" tabindex="0" href="/client/html-snippet">HTML Snippet</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item js-icon sidebar-icon sdk-sidebar-icon"><a class="menu__link" tabindex="0" href="/client/javascript-sdk">JavaScript</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item react-icon sidebar-icon sdk-sidebar-icon"><a class="menu__link" tabindex="0" href="/client/javascript-sdk/react">React</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item next-icon sidebar-icon sdk-sidebar-icon"><a class="menu__link" tabindex="0" href="/client/javascript-sdk/next-js">Next.js</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item android-icon sidebar-icon sdk-sidebar-icon"><a class="menu__link" tabindex="0" href="/client/androidClientSDK">Android</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item ios-icon sidebar-icon sdk-sidebar-icon"><a class="menu__link" tabindex="0" href="/client/iosClientSDK">iOS/tvOS/macOS</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item node-icon sidebar-icon sdk-sidebar-icon"><a class="menu__link" tabindex="0" href="/server-core/node-core">Node Core</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-3 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" tabindex="0" href="/client/cpp-client-sdk">More Client SDKs</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-3 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" tabindex="0" href="/server/dotnetSDK">More Server SDKs</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-3 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" tabindex="0" href="/server-core/legacy-sdks">Legacy Server SDKs</a><button aria-label="Expand sidebar category &#x27;Legacy Server SDKs&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-3 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" tabindex="0" href="/azureai/introduction">Azure AI</a><button aria-label="Expand sidebar category &#x27;Azure AI&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-3 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" tabindex="0" href="/guides/node-express-feature-flags">Advanced SDK Methods</a></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/server/deprecation-notices">Deprecation Notices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed key-icon sidebar-icon"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" tabindex="0" href="/http-api">APIs</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed integrations-icon sidebar-icon"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" tabindex="0" href="/integrations/introduction">Integrations</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed data-icon sidebar-icon"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" tabindex="0" href="/metrics/101">Data &amp; Metrics</a></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item question-icon sidebar-icon"><a class="menu__link" tabindex="0" href="/faq">FAQs</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link">Products</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed feature-icon sidebar-icon"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" tabindex="0" href="/feature-flags/working-with">Feature Flags</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed xp-icon sidebar-icon"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" tabindex="0" href="/experiments-plus">Experimentation</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed chart-icon sidebar-icon"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" tabindex="0" href="/product-analytics/overview">Product Analytics</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed web-icon sidebar-icon"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" tabindex="0" href="/webanalytics/overview">Web Analytics</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed play-icon sidebar-icon"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" tabindex="0" href="/session-replay/overview">Session Replay</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed whn-icon sidebar-icon"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" tabindex="0" href="/statsig-warehouse-native/introduction">Warehouse Native</a></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link">Management &amp; Admin</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed team-icon sidebar-icon"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" tabindex="0" href="/access-management/introduction">Workspace Management</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed template-icon sidebar-icon"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" tabindex="0" href="/org-admin/organization_policies">Collaboration</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed admin-icon sidebar-icon"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" tabindex="0" href="/compliance/introduction">Privacy</a><button aria-label="Expand sidebar category &#x27;Privacy&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed infra-icon sidebar-icon"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" tabindex="0" href="/infrastructure/introduction">Infrastructure Operations</a><button aria-label="Expand sidebar category &#x27;Infrastructure Operations&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li></ul></li></ul></nav></div></div></aside><main class="docMainContainer_TBSr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">New to Statsig?</span><meta itemprop="position" content="1"></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">SDKs &amp; Frameworks</span><meta itemprop="position" content="2"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Debugging</span><meta itemprop="position" content="3"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>SDK Debugging</h1></header><h2 class="anchor anchorWithStickyNavbar_LWe7" id="debugging-tools">Debugging Tools<a href="#debugging-tools" class="hash-link" aria-label="Direct link to Debugging Tools" title="Direct link to Debugging Tools">​</a></h2> <p>When debugging why a certain user got a certain value, there are a number of tools at your disposal. Here are some troubleshooting tools:</p> <h3 class="anchor anchorWithStickyNavbar_LWe7" id="diagnostics--log-stream">Diagnostics / Log Stream<a href="#diagnostics--log-stream" class="hash-link" aria-label="Direct link to Diagnostics / Log Stream" title="Direct link to Diagnostics / Log Stream">​</a></h3> <p>Every config in the Statsig ecosystem (meaning Feature Gates, Dynamic Configs, Experiments, and Layers) has a Setup tab and a Diagnostics tab. The diagnostics tab is useful for seeing higher level pass/fail/bucketing population sizes over time, via the checks chart at the top.</p> <p><img decoding="async" loading="lazy" src="https://user-images.githubusercontent.com/74584483/234955649-7ddef621-397a-44e5-b864-fa0abc29310f.png" alt="Screen Shot 2023-04-27 at 11 17 08 AM" class="img_ev3q"></p> <p>For debugging specific checks, the logstream at the bottom is useful and shows both production and non production exposures in near real time.</p> <p><u>Note:</u> To see logs from non-production environments, toggle the &quot;Show non-production logs&quot; in the upper right corner.</p> <p><img decoding="async" loading="lazy" src="https://user-images.githubusercontent.com/74584483/234956317-e65f7fd3-d87d-4616-b905-ee4df097863e.png" alt="Screen Shot 2023-04-27 at 11 20 14 AM" class="img_ev3q"></p> <h3 class="anchor anchorWithStickyNavbar_LWe7" id="logging-levels-and-expected-information">Logging Levels and Expected Information<a href="#logging-levels-and-expected-information" class="hash-link" aria-label="Direct link to Logging Levels and Expected Information" title="Direct link to Logging Levels and Expected Information">​</a></h3> <p>Log-line feedback is one of the simplest tools you have to understand how your SDK is behaving. Our SDKs have multiple log levels to decide what information you&#x27;d like to receive:</p> <ul> <li>Debug: Detailed logs useful for new users onboarding with the SDK and for diagnosing potential issues, such as:<!-- --> <ul> <li>Messages when a feature gate does not exist</li> <li>Tracking process flows within the SDK</li> </ul> </li> <li>Info: General information about the SDK’s operation, typically relevant to regular usage, such as:<!-- --> <ul> <li>Messages regarding SDK initialization, including source and version information</li> <li>Notifications when the configuration store is populated</li> </ul> </li> <li>Warning: Logs about unusual events that may impact functionality but are automatically managed and recovered, such as:<!-- --> <ul> <li>Messages on non critical errors caught by the SDK</li> <li>Notifications about reconnection attempts to gRPC services</li> </ul> </li> <li>Error: Critical logs about issues that severely impact the SDK’s functionality, such as:<!-- --> <ul> <li>Messages about initialization failures or timeouts</li> <li>Notifications indicating gRPC fallback, suggesting gRPC is unavailable or incorrect configuration</li> </ul> </li> </ul> <h2 class="anchor anchorWithStickyNavbar_LWe7" id="evaluation-details">Evaluation Details<a href="#evaluation-details" class="hash-link" aria-label="Direct link to Evaluation Details" title="Direct link to Evaluation Details">​</a></h2> <p>Clicking on a specific exposure shows more details on its evaluation. You can see info like the rule and userID in the exposure stream, and clicking on an individual row shows additional factors like Evaluation Reason, SDK, Server Details and more - all of which can help you debug your setup.</p> <p><img decoding="async" loading="lazy" src="https://user-images.githubusercontent.com/74584483/234956676-440a9ec1-f54d-4b81-b095-6ccf1327ece4.png" alt="Screen Shot 2023-04-27 at 11 21 50 AM" class="img_ev3q"></p> <h3 class="anchor anchorWithStickyNavbar_LWe7" id="evaluation-reason">Evaluation Reason<a href="#evaluation-reason" class="hash-link" aria-label="Direct link to Evaluation Reason" title="Direct link to Evaluation Reason">​</a></h3> <p><strong>Evaluation reasons</strong> are a way to understand why a certain value was returned for a given check. All SDKs provide the <a href="/client/javascript-sdk/init-strategies/">Data Source</a> - which is where your Statsig Client/Server instance is getting its data. Newer SDKs also provide a Reason, which lets you know if an individual check was valid or overridden versus how you&#x27;ve initialized. These reasons are intended to be used for debugging and internal logging purposes only, and are sometimes updated in new SDK versions.</p> <img src="/img/evaldetails.png" width="500px"> <div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Client SDKs</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Server SDKS</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><h3 class="anchor anchorWithStickyNavbar_LWe7" id="1-data-source">#1. Data Source<a href="#1-data-source" class="hash-link" aria-label="Direct link to #1. Data Source" title="Direct link to #1. Data Source">​</a></h3><p>For client SDKs, the evaluation state can be:</p><table><thead><tr><th>Source Name</th><th>Description</th><th>Type</th><th>Debugging Suggestions</th></tr></thead><tbody><tr><td><code>Network</code></td><td>Fetched at SDK initialization time from Statsig&#x27;s servers.</td><td>Normal</td><td></td></tr><tr><td><code>Bootstrap</code></td><td>From bootstrapping the client SDK with a set of values (often from a Statsig Server SDK instance, see <a href="/client/javascript-sdk/init-strategies/#2-bootstrap-initialization">here</a>).</td><td>Normal</td><td></td></tr><tr><td><code>Prefetch</code></td><td>Fetched from the <code>prefetchUsers</code> API (js-client only), see <a href="/client/javascript-sdk/#prefetching-users">here</a>.</td><td>Normal</td><td></td></tr><tr><td><code>NetworkNotModified</code></td><td>A request to the Statsig network was successful, but the cached values were already up to date for this user.</td><td>Normal</td><td></td></tr><tr><td><code>Sticky</code> (old SDKs)</td><td>Persisted from a sticky evaluation previously.</td><td>Normal</td><td></td></tr><tr><td><code>LocalOverride</code> (old SDKs)</td><td>From an override set locally on the SDK via an override API.</td><td>Normal</td><td></td></tr><tr><td><code>Cache</code></td><td>Loaded from the local storage cache for the current user, and network result was not available.</td><td>Normal</td><td>Not explicitly an error state, but you may be checking a config before initialize returns.</td></tr><tr><td><code>InvalidBootstrap</code></td><td>The set of values was for a different user than the SDK was initialized with. These are discarded for analysis.</td><td>Error</td><td>See <a href="#invalid-bootstrap">Fixing InvalidBootstrap</a></td></tr><tr><td><code>BootstrapStableIDMismatch</code></td><td>The stableID of the user was different for the user added on the client side than the one you bootstrapped with on the server-side. If your experiment or gate is not StableID based, this can be treated as a warning. These exposures are not discarded for analysis.</td><td>Error</td><td>See <a href="#bootstrapstableidmismatch">Fixing BootstrapStableIDMismatch</a></td></tr><tr><td><code>Error</code></td><td>An unknown error has occurred, and was logged to Statsig servers.</td><td>Error</td><td>Reach out to us in <a href="https://statsig.com/slack" target="_blank" rel="noopener noreferrer">Slack</a> for support.</td></tr><tr><td><code>Error:NoClient</code> (js-client-only)</td><td>No client was found in your StatsigContext.</td><td>Error</td><td>You&#x27;ve likely made a call to a Statsig hook outside of a <code>&lt;StatsigProvider&gt;</code>, verify your setup and try again.</td></tr><tr><td><code>Unrecognized</code> (old SDKs)</td><td>The SDK was initialized, but this gate/experiment/config did not exist in the set of values.</td><td>Error</td><td>Confirm the experiment or gate is configured in the Statsig console and you&#x27;re using the correct API key.</td></tr><tr><td><code>NoValues</code></td><td>You&#x27;ve attempted to initialize, but it didn&#x27;t successfully retrieve values.</td><td>Error</td><td>You&#x27;re either calling initializeSync before users have cached values, or your call to initializeAsync has failed (check that your client key is correct!)</td></tr><tr><td><code>Loading</code></td><td>You&#x27;ve tried to initialize, but it hasn&#x27;t finished yet.</td><td>Error</td><td>If you&#x27;re using initializeAsync, you may need to await it, or otherwise prevent config checks before values are loaded.</td></tr><tr><td><code>Uninitialized</code></td><td>You haven&#x27;t attempted to initialize yet.</td><td>Error</td><td>Ensure you&#x27;re explicitly calling initializeAsync() or initializeSync(), or check if you&#x27;ve passed any StatsigOptions that could prevent network requests from happening.</td></tr></tbody></table><h3 class="anchor anchorWithStickyNavbar_LWe7" id="2-reason-new-sdks-only">#2. Reason (new SDKs only)<a href="#2-reason-new-sdks-only" class="hash-link" aria-label="Direct link to #2. Reason (new SDKs only)" title="Direct link to #2. Reason (new SDKs only)">​</a></h3><p>Newer versions of the sdk will contain both the above initialization state and the source of an individual value that was returned.</p><table><thead><tr><th>Reason Name</th><th>Description</th><th>Type</th><th>Debugging Suggestions</th></tr></thead><tbody><tr><td><code>Recognized</code></td><td>The value was recognized in the set of configs the client was operating with</td><td>Normal</td><td></td></tr><tr><td><code>Sticky</code></td><td>The value is from <code>keepDeviceValue = true</code> on the method call</td><td>Normal</td><td></td></tr><tr><td><code>LocalOverride</code></td><td>The value is from a local override set on the sdk</td><td>Normal</td><td></td></tr><tr><td><code>Unrecognized</code></td><td>The value was not included in the set of configs the client was operating with</td><td>Error</td><td>Confirm the experiment or gate is configured in the Statsig console and you&#x27;re using the correct API key.</td></tr></tbody></table><p>For example: <code>Network:Recognized</code> means the sdk had up to date values from a successful initialization network request, and the gate/config/experiment you were checking was defined in the payload.</p><p>If you are not sure why a config was not included (resulting in an &quot;Unrecognized&quot; source), it could be excluded due to <a href="/sdk-keys/target-apps">Target Apps</a>, or <a href="/client/concepts/initialize#bootstrapping-overview">Client Bootstrapping</a>.</p></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><h3 class="anchor anchorWithStickyNavbar_LWe7" id="1-data-source-1">#1. Data Source<a href="#1-data-source-1" class="hash-link" aria-label="Direct link to #1. Data Source" title="Direct link to #1. Data Source">​</a></h3><p>For server SDKs, the evaluation state can be:</p><table><thead><tr><th>Source Name</th><th>Description</th><th>Type</th><th>Debugging Suggestions</th></tr></thead><tbody><tr><td><code>Network</code></td><td>Configurations fetched at SDK initialization time from Statsig&#x27;s servers.</td><td>Normal</td><td></td></tr><tr><td><code>Bootstrap</code></td><td>From bootstrapping the server SDK with a set of values.</td><td>Normal</td><td></td></tr><tr><td><code>DataAdapter</code></td><td>Values come from the provided data adapter or data store, see <a href="https://docs.statsig.com/server/concepts/data_store/#dataadapter-or-datastore" target="_blank" rel="noopener noreferrer">here</a> for more.</td><td>Normal</td><td></td></tr><tr><td><code>LocalOverride</code> (old SDKs only)</td><td>From an override set locally on the SDK via an override API.</td><td>Normal</td><td></td></tr><tr><td><code>StatsigNetwork</code></td><td>Custom proxy/GRPC streaming has triggered the fallback behavior, thus falling back to Statsig API.</td><td>Fallback</td><td>Review your <a href="/server/concepts/forward_proxy/">proxy setup</a>, your values are up-to-date but not using the expected methodology.</td></tr><tr><td><code>Uninitialized</code></td><td>The SDK was not yet successfully initialized.</td><td>Error</td><td>Revisit your <a href="/client/javascript-sdk/init-strategies/">Initialization Strategy</a>, as you&#x27;re checking configs before initialization is complete.</td></tr><tr><td><code>Unrecognized</code> (old SDKs only)</td><td>The SDK was initialized, but this gate/experiment/config did not exist in the set of values.</td><td>Error</td><td>Confirm the experiment or gate is configured in the Statsig console and you&#x27;re using the correct API key.</td></tr></tbody></table><h3 class="anchor anchorWithStickyNavbar_LWe7" id="2-reason-new-sdks-only-1">#2. Reason (new SDKs only)<a href="#2-reason-new-sdks-only-1" class="hash-link" aria-label="Direct link to #2. Reason (new SDKs only)" title="Direct link to #2. Reason (new SDKs only)">​</a></h3><table><thead><tr><th>Reason Name</th><th>Description</th><th>Type</th><th>Debugging Suggestions</th></tr></thead><tbody><tr><td><code>LocalOverride</code></td><td>From an override set locally on the SDK via an override API.</td><td>Normal</td><td></td></tr><tr><td>None</td><td>Successful evaluation.</td><td>Normal</td><td></td></tr><tr><td><code>Unrecognized</code></td><td>This gate/experiment/config did not exist in the set of values.</td><td>Error</td><td>Confirm the experiment or gate is configured in the Statsig console and you&#x27;re using the correct API key.</td></tr><tr><td><code>Unsupported</code></td><td>The SDK does not support this type of condition type/operator. Usually, this means the SDK is out of date and missing new features.</td><td>Error</td><td>Update your SDK to the latest version.</td></tr><tr><td><code>Error</code></td><td>An unknown error occurred during evaluation.</td><td>Error</td><td>Reach out to us in <a href="https://statsig.com/slack" target="_blank" rel="noopener noreferrer">Slack</a> for support.</td></tr></tbody></table><p>So <code>Network</code> means the sdk was initialized with values from the network, and the evaluation was successful. <code>Network:Unrecognized</code>, means the sdk was initialized with values from the network, but the gate/config/experiment you were checking was not included in the payload.</p></div></div></div> <h3 class="anchor anchorWithStickyNavbar_LWe7" id="evaluation-times">Evaluation Times<a href="#evaluation-times" class="hash-link" aria-label="Direct link to Evaluation Times" title="Direct link to Evaluation Times">​</a></h3> <p>Evaluation times can help you understand the age of the configuration values the SDK is operating with, and if they might be causing unexpected results.</p> <h4 class="anchor anchorWithStickyNavbar_LWe7" id="lcut-last-config-updated-time">LCUT: Last Config Updated Time<a href="#lcut-last-config-updated-time" class="hash-link" aria-label="Direct link to LCUT: Last Config Updated Time" title="Direct link to LCUT: Last Config Updated Time">​</a></h4> <p>Whenever you modify a gate, config, or experiment, the LCUT (Last Config Updated Time) for your project is updated to the current time. This timestamp indicates the most recent changes that all SDKs should reflect to ensure they are using the latest configurations. If you&#x27;ve made no changes to your project in the last 2 hours, and your SDK is showing an LCUT (on client SDKs) or configSyncTime (on server SDKs) as of 2 hours ago, then you&#x27;re evaluating the most up to date definition of that gate/experiment. If the LCUT is older than that, your SDK is operating with stale values. Outdated values on a client SDK usually indicate that the user hasn&#x27;t encountered a recent initialize() or updateUser() call (e.g., they have a long-lived browser tab), which is common and expected. On Server SDKs, it could mean an issue with a data adapter, or a configuration propagation delay.</p> <div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Client SDKs</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Server SDKs</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><table><thead><tr><th>Time Field</th><th>Description</th><th>SDKs Available In</th></tr></thead><tbody><tr><td>LCUT (Last Config Updated Time)</td><td>LCUT is the last time a configuration change was made in the Statsig console - this field represents the last config change that the SDK is operating with.</td><td>Javascript (incl. React, RN), iOS, Dart.</td></tr><tr><td>receivedAt</td><td>When the SDK received the configuration values for this user.</td><td>Javascript (incl. React, RN), iOS, Dart.</td></tr></tbody></table></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><table><thead><tr><th>Time Field</th><th>Description</th><th>SDKs Available In</th></tr></thead><tbody><tr><td>initTime</td><td>The last config update time (LCUT) received when the SDK was first initialized (typically, on server startup)</td><td>All Server SDKs except Rust</td></tr><tr><td>configSyncTime</td><td>The current last config update time (LCUT) that the SDK is operating with, I.E., the time up until which it has received updates from the network.</td><td>All Server SDKs except Rust</td></tr><tr><td>serverTime</td><td>The current time on your server (Date.now()) when an evaluation is made.</td><td>All Server SDKs except Rust</td></tr></tbody></table></div></div></div> <h3 class="anchor anchorWithStickyNavbar_LWe7" id="mocking-statsig--local-mode">Mocking Statsig / Local Mode<a href="#mocking-statsig--local-mode" class="hash-link" aria-label="Direct link to Mocking Statsig / Local Mode" title="Direct link to Mocking Statsig / Local Mode">​</a></h3> <p>To facilitate testing with Statsig, we provide a few tools to help you test your code without fetching values from statsig network:</p> <ul> <li> <p>Local Mode: By setting the localMode parameter to true, the SDK will operate without making network calls, returning only default values. This is ideal for dummy or test environments that should remain disconnected from the network.</p> </li> <li> <p>Override APIs: Utilize the overrideGate and overrideConfig APIs on the global Statsig interface. These allow you to set overrides for gates or configurations either for specific users or for all users by omitting the user ID.</p> </li> </ul> <p>We recommend enabling localMode and applying overrides for gates, configurations, or experiments to specific values to thoroughly test the various code flows you are developing.</p> <p>For specific SDK implementation: refer to StatsigOptions in the respective SDK documentation.</p> <h3 class="anchor anchorWithStickyNavbar_LWe7" id="client-sdk-debugger">Client SDK Debugger<a href="#client-sdk-debugger" class="hash-link" aria-label="Direct link to Client SDK Debugger" title="Direct link to Client SDK Debugger">​</a></h3> <p>It can be useful to inspect the current values that a Client SDK is using internally. For this, we have a Client SDK Debugger. With this tool, you can see the current User object the SDK is using as well as the gate/config values associated with it.</p> <p>Javascript/React: Via a Chrome Extension <a href="https://github.com/statsig-io/statsig-sdk-debugger-chrome-extension" target="_blank" rel="noopener noreferrer">https://github.com/statsig-io/statsig-sdk-debugger-chrome-extension</a></p> <p>NOTE: Accounts signing in to the Statsig console via Google SSO are not supported by this debugging tool.</p> <p>iOS: Available with <code>Statsig.openDebugView()</code>. Available in <a href="https://github.com/statsig-io/ios-sdk/releases/tag/v1.26.0" target="_blank" rel="noopener noreferrer">v1.26.0</a> and <a href="https://github.com/statsig-io/ios-sdk/releases" target="_blank" rel="noopener noreferrer">above</a>.</p> <p>Android: Available with <code>Statsig.openDebugView()</code>. Available in <a href="https://github.com/statsig-io/android-sdk/releases/tag/4.29.0" target="_blank" rel="noopener noreferrer">v4.29.0</a> and <a href="https://github.com/statsig-io/android-sdk/releases/" target="_blank" rel="noopener noreferrer">above</a>.</p> <table><thead><tr><th>Landing</th><th>Gates List</th><th>Gate Details</th><th>Experiment Details</th></tr></thead><tbody><tr><td><img decoding="async" loading="lazy" src="https://github.com/statsig-io/statsig-sdk-debugger-chrome-extension/assets/95646168/fa6d7237-eb47-4f09-896c-696cfd5c956c" alt="client-debugger-landing" class="img_ev3q"></td><td><img decoding="async" loading="lazy" src="https://github.com/statsig-io/statsig-sdk-debugger-chrome-extension/assets/95646168/161d8f35-a9b8-4ff9-b549-e04d04acac8a" alt="client-debugger-gates-list" class="img_ev3q"></td><td><img decoding="async" loading="lazy" src="https://github.com/statsig-io/statsig-sdk-debugger-chrome-extension/assets/95646168/ab15e586-5259-4475-8f5c-018b2ab6e8db" alt="client-debugger-gate-info" class="img_ev3q"></td><td><img decoding="async" loading="lazy" src="https://github.com/statsig-io/statsig-sdk-debugger-chrome-extension/assets/95646168/920a6e8a-eb84-4d37-bf77-bb909a575d58" alt="client-debugger-experiment-details" class="img_ev3q"></td></tr></tbody></table> <h2 class="anchor anchorWithStickyNavbar_LWe7" id="faqs">FAQs<a href="#faqs" class="hash-link" aria-label="Direct link to FAQs" title="Direct link to FAQs">​</a></h2> <p>For more sdk specific questions, check out the FAQs on the respective SDK pages. If you have more questions, feel free to reach out directly in our <a href="https://statsig.com/slack" target="_blank" rel="noopener noreferrer">Slack Community</a>.</p> <h3 class="anchor anchorWithStickyNavbar_LWe7" id="invalid-bootstrap">Invalid Bootstrap<a href="#invalid-bootstrap" class="hash-link" aria-label="Direct link to Invalid Bootstrap" title="Direct link to Invalid Bootstrap">​</a></h3> <p>This can occur when you are <a href="https://docs.statsig.com/search?q=Client+SDK+Bootstrapping" target="_blank" rel="noopener noreferrer">Bootstrapping</a> a Statsig Client SDK with your own prefetched or generated values. The InvalidBootstrap reason is signally that the current user the Client SDK is operating against is not the same as the one used to generate the bootstrap values.</p> <p>The following pseudo code highlights how this can occur:</p> <div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic">// Server Side</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">userA </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">userID</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">&#x27;user-a&#x27;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">bootstrapValues </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token maybe-class-name">Statsig</span><span class="token punctuation" style="color:#393A34">.</span><span class="token method function property-access" style="color:#d73a49">getClientInitializeResponse</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">userA</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic">// Client Side</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">bootstrapValues </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">fetchStatsigValuesFromMyServers</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"> </span><span class="token comment" style="color:#999988;font-style:italic">// &lt;- Network request that executes the above logic</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">userB </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">userID</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">&#x27;user-b&#x27;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"> </span><span class="token comment" style="color:#999988;font-style:italic">// &lt;- This is not the same User</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token maybe-class-name">Statsig</span><span class="token punctuation" style="color:#393A34">.</span><span class="token method function property-access" style="color:#d73a49">initialize</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">&quot;client-key&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> userB</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">initializeValues</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> bootstrapValues </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <p>Users must also be a 1 to 1 match. The SDK will treat a user with slightly different values as a completely different user. For example, the following two user objects would also trigger InvalidBootstrap even though they have the same UserID.</p> <div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">userA </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">userID</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">&#x27;user-a&#x27;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">userAExt </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">userID</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">&#x27;user-a&#x27;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">customIDs</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">employeeID</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">&#x27;employee-a&#x27;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <h3 class="anchor anchorWithStickyNavbar_LWe7" id="bootstrapstableidmismatch">BootstrapStableIDMismatch<a href="#bootstrapstableidmismatch" class="hash-link" aria-label="Direct link to BootstrapStableIDMismatch" title="Direct link to BootstrapStableIDMismatch">​</a></h3> <p>This error is similar to InvalidBootstrap - but isolated to the StableID of the user. In a StableID based experiment or Gate, this is a meaningful issue - as we will bucket users based on StableID, meaning their buckets could be incorrect. A common situation that this occurs in is when you use a user object on both the client and server side that doesn&#x27;t have an explicitly set StableID: client SDKs will generate a StableID for the user, but the server SDK will not - creating a mismatch.</p> <p>A similar example to the InvalidBootstrap can cause this issue:</p> <div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic">// Server Side</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">userA </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">bootstrapValues </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token maybe-class-name">Statsig</span><span class="token punctuation" style="color:#393A34">.</span><span class="token method function property-access" style="color:#d73a49">getClientInitializeResponse</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">userA</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic">// Client Side</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">bootstrapValues </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">fetchStatsigValuesFromMyServers</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"> </span><span class="token comment" style="color:#999988;font-style:italic">// &lt;- Network request that executes the above logic</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">userB </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">stableID</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">&#x27;12345&#x27;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"> </span><span class="token comment" style="color:#999988;font-style:italic">// &lt;- This will generate a StableID mismatch, as the server-side user does not have a StableID.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token maybe-class-name">Statsig</span><span class="token punctuation" style="color:#393A34">.</span><span class="token method function property-access" style="color:#d73a49">initialize</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">&quot;client-key&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> userB</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">initializeValues</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> bootstrapValues </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <p>As mentioned above, Statsig&#x27;s client-side SDKs will also generate a StableID for the user if one is not provided, so an empty user object could trigger this error - even when the server and client-side user objects are the same:</p> <div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">userC </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"> </span><span class="token comment" style="color:#999988;font-style:italic">// &lt;- despite being the same as userA, the client SDK will generate a StableID for userC, causing a mismatch.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token maybe-class-name">Statsig</span><span class="token punctuation" style="color:#393A34">.</span><span class="token method function property-access" style="color:#d73a49">initialize</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">&quot;client-key&quot;</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> userC</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> </span><span class="token literal-property property" style="color:#36acaa">initializeValues</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> bootstrapValues </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <h3 class="anchor anchorWithStickyNavbar_LWe7" id="environments">Environments<a href="#environments" class="hash-link" aria-label="Direct link to Environments" title="Direct link to Environments">​</a></h3> <p>SDKs get the environment configurations from initialization options. If no environment is provided, the SDK will default to the production environment. If you are wondering why a certain user is not passing an environment-based condition and what you SDK is initialized with, you can check the user properties in any of the log streams. The <code>statsigEnvironment</code> property will show you the environment the SDK is operating in.</p> <h3 class="anchor anchorWithStickyNavbar_LWe7" id="maximizing-event-throughput">Maximizing Event Throughput<a href="#maximizing-event-throughput" class="hash-link" aria-label="Direct link to Maximizing Event Throughput" title="Direct link to Maximizing Event Throughput">​</a></h3> <div class="theme-admonition theme-admonition-note admonition_xJq3 alert alert--secondary"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_BuS1"><p>This is currently only applicable to Python SDK v0.45.0+</p></div></div> <p>The SDK batches and flushes events in the background to our server. When the volume of incoming events exceeds the SDK&#x27;s flushing capacity, some events may be dropped after a certain number of retries. To reduce the chances of event loss, you can adjust several settings in the Statsig options:</p> <ul> <li>Event Queue Size: Determines how many events are sent in a single batch.</li> <li>Increasing the event queue size allows more events to be flushed at once, but it will consume more memory. It&#x27;s recommended not to exceed 1800 events per batch, as larger payloads may result in failed requests.</li> <li>Retry Queue Size: Specifies how many batches of events the SDK will hold and retry.</li> <li>By default, the SDK keeps 10 batches in the retry queue. Increasing this limit allows more batches to be retried, but also increases memory usage. Tuning these options can help manage event volume more effectively and minimize the risk of event drops.</li> </ul></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="row margin-top--sm theme-doc-footer-edit-meta-row"><div class="col"><a href="https://github.com/statsig-io/docs/edit/main/docs/sdks/debugging.mdx" target="_blank" rel="noopener noreferrer" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_JAkA"><span class="theme-last-updated">Last updated<!-- --> on <b><time datetime="2025-02-21T04:39:37.000Z" itemprop="dateModified">Feb 21, 2025</time></b></span></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/client/concepts/initialize"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Initializing</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/client/html-snippet"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">HTML Snippet</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#debugging-tools" class="table-of-contents__link toc-highlight">Debugging Tools</a><ul><li><a href="#diagnostics--log-stream" class="table-of-contents__link toc-highlight">Diagnostics / Log Stream</a></li><li><a href="#logging-levels-and-expected-information" class="table-of-contents__link toc-highlight">Logging Levels and Expected Information</a></li></ul></li><li><a href="#evaluation-details" class="table-of-contents__link toc-highlight">Evaluation Details</a><ul><li><a href="#evaluation-reason" class="table-of-contents__link toc-highlight">Evaluation Reason</a></li><li><a href="#1-data-source" class="table-of-contents__link toc-highlight">#1. Data Source</a></li><li><a href="#2-reason-new-sdks-only" class="table-of-contents__link toc-highlight">#2. Reason (new SDKs only)</a></li><li><a href="#1-data-source-1" class="table-of-contents__link toc-highlight">#1. Data Source</a></li><li><a href="#2-reason-new-sdks-only-1" class="table-of-contents__link toc-highlight">#2. Reason (new SDKs only)</a></li><li><a href="#evaluation-times" class="table-of-contents__link toc-highlight">Evaluation Times</a></li><li><a href="#mocking-statsig--local-mode" class="table-of-contents__link toc-highlight">Mocking Statsig / Local Mode</a></li><li><a href="#client-sdk-debugger" class="table-of-contents__link toc-highlight">Client SDK Debugger</a></li></ul></li><li><a href="#faqs" class="table-of-contents__link toc-highlight">FAQs</a><ul><li><a href="#invalid-bootstrap" class="table-of-contents__link toc-highlight">Invalid Bootstrap</a></li><li><a href="#bootstrapstableidmismatch" class="table-of-contents__link toc-highlight">BootstrapStableIDMismatch</a></li><li><a href="#environments" class="table-of-contents__link toc-highlight">Environments</a></li><li><a href="#maximizing-event-throughput" class="table-of-contents__link toc-highlight">Maximizing Event Throughput</a></li></ul></li></ul></div></div></div></div></main></div></div></div><footer class="footer footer--dark"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col"><div class="footer__title">Docs</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/">Getting Started</a></li><li class="footer__item"><a class="footer__link-item" href="/faq">FAQ</a></li></ul></div><div class="col footer__col"><div class="footer__title">More</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://statsig.com" target="_blank" rel="noopener noreferrer" class="footer__link-item">Statsig Home<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://statsig.com/blog" target="_blank" rel="noopener noreferrer" class="footer__link-item">Blog<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://statsig.com/slack" target="_blank" rel="noopener noreferrer" class="footer__link-item">Slack Community<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://github.com/statsig-io" target="_blank" rel="noopener noreferrer" class="footer__link-item">Code<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">Copyright (c) 2025 Statsig, Inc. | Thanks Docusaurus</div></div></div></footer></div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10