From dd86d0964d391e9748843aa1a6400d73c3a6d9f9 Mon Sep 17 00:00:00 2001
From: dan <dan.abramov@gmail.com>
Date: Fri, 8 Mar 2024 04:33:42 +0000
Subject: Enable gating and experimentation on native, send init event (#3149)

* Add the mobile fork

* Add init event
---
 src/lib/statsig/statsig.web.tsx | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

(limited to 'src/lib/statsig/statsig.web.tsx')

diff --git a/src/lib/statsig/statsig.web.tsx b/src/lib/statsig/statsig.web.tsx
index 6508131c4..fc66e8d9f 100644
--- a/src/lib/statsig/statsig.web.tsx
+++ b/src/lib/statsig/statsig.web.tsx
@@ -1,5 +1,9 @@
 import React from 'react'
-import {StatsigProvider, useGate as useStatsigGate} from 'statsig-react'
+import {
+  Statsig,
+  StatsigProvider,
+  useGate as useStatsigGate,
+} from 'statsig-react'
 import {useSession} from '../../state/session'
 import {sha256} from 'js-sha256'
 
@@ -13,6 +17,14 @@ const statsigOptions = {
   initTimeoutMs: 1,
 }
 
+export function logEvent(
+  eventName: string,
+  value?: string | number | null,
+  metadata?: Record<string, string> | null,
+) {
+  Statsig.logEvent(eventName, value, metadata)
+}
+
 export function useGate(gateName: string) {
   const {isLoading, value} = useStatsigGate(gateName)
   if (isLoading) {
-- 
cgit 1.4.1

