Frequently Asked Questions

A curated summary of the top questions asked on our Slack community, often relating to implementation, functionality, and building better products generally.
Statsig FAQs
OpenAI Microsoft Notion ea Univision affirm Cruise Attentive Cider outschool UrbanSportsClub Plex
GENERAL

How can I troubleshoot a flag not working in the Statsig React SDK, and get more detailed error information?

Date of slack thread: 8/11/24

Anonymous: Whenever I have an issue with Statsig, typically a flag not working, I’m unsure how to troubleshoot. Using your React SDK, I can see the reason the flag is not working is Error. I would really love to know the nature of the error whenever one exists. How can I get that information?

Anonymous: Looking at the linked doc, every time I’ve had a hair-pulling experience with Statsig, I’m getting Reason: Error. According to the docs there’s not much else to do but pull more hair. Statsig is great when it works, and makes me want to promptly remove it from my stack when it doesn’t. It’s the only thing in my stack that I feel this way about, I’m not a rager lol. It’s the experience of staring at something that I followed instructions to use, and it just doesn’t work, and there’s no real recourse. Hopefully this is somewhat useful feedback. Unknown error should be limited to an unexpected 500 on Statsig’s side. I need info if I’m going to fix my problem.

Vijaye (Statsig): Appreciate the feedback, Shawn. We will debug and see what more detail we could share in this situation. For the specific issue, could you share more of your implementation detail, so we can help you in the right direction? The initialize code, user object, etc?

Anonymous: It’s a react native project, and I’m trying to use a flag before the user is authenticated via stable id. My other flags using user id still work fine, so initialization isn’t failing. The stable id flag just isn’t working.

Statsig initialization:

const client = useMemo(() => {
  const instance = new StatsigClient(
    STATSIG_CLIENT_KEY,
    {},
    {
      environment: { tier: NODE_ENV },
    },
  )
  instance.initializeAsync()
  return instance
}, [])

useEffect(() => {
  if (!user) {
    return
  }
  client.updateUserAsync({ userID: user._id, email: user.email })
}, [user])

const warming = warmCachingFromAsyncStorage(client)

return (
  <StatsigProviderExpo client={client} cacheWarming={warming}>
    {children}
  </StatsigProviderExpo>
)

Anonymous: For the flag itself I’m just using useGateValue(). The name is correct, quadruple checked that, and then copy-pasted from the dashboard for good measure.

Anonymous: Flag in question is auth_diagnostics.

Vijaye (Statsig): <@U01RAN2FKJP> could you pls take a look here?

Join the #1 experimentation community

Connect with like-minded product leaders, data scientists, and engineers to share the latest in product experimentation.

Try Statsig Today

Get started for free. Add your whole team!

Why the best build with us

OpenAI OpenAI
Brex Brex
Notion Notion
SoundCloud SoundCloud
Ancestry Ancestry
At OpenAI, we want to iterate as fast as possible. Statsig enables us to grow, scale, and learn efficiently. Integrating experimentation with product analytics and feature flagging has been crucial for quickly understanding and addressing our users' top priorities.
OpenAI
Dave Cummings
Engineering Manager, ChatGPT
Brex's mission is to help businesses move fast. Statsig is now helping our engineers move fast. It has been a game changer to automate the manual lift typical to running experiments and has helped product teams ship the right features to their users quickly.
Brex
Karandeep Anand
President
At Notion, we're continuously learning what our users value and want every team to run experiments to learn more. It’s also critical to maintain speed as a habit. Statsig's experimentation platform enables both this speed and learning for us.
Notion
Mengying Li
Data Science Manager
We evaluated Optimizely, LaunchDarkly, Split, and Eppo, but ultimately selected Statsig due to its comprehensive end-to-end integration. We wanted a complete solution rather than a partial one, including everything from the stats engine to data ingestion.
SoundCloud
Don Browning
SVP, Data & Platform Engineering
We only had so many analysts. Statsig provided the necessary tools to remove the bottleneck. I know that we are able to impact our key business metrics in a positive way with Statsig. We are definitely heading in the right direction with Statsig.
Ancestry
Partha Sarathi
Director of Engineering
We use cookies to ensure you get the best experience on our website.
Privacy Policy