Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: __STATSIG__ to window.Statsig #2414

Merged
merged 5 commits into from
Dec 13, 2024
Merged

fix: __STATSIG__ to window.Statsig #2414

merged 5 commits into from
Dec 13, 2024

Conversation

tore-statsig
Copy link
Contributor

No description provided.

@@ -91,7 +91,7 @@ Now let's use this Dynamic Config to create a different landing page experience
After adding the SDK to the webpage via the [jsdelivr cdn](https://www.jsdelivr.com/package/npm/@statsig/js-client), we initialize the SDK:

```js
const client = new window.__STATSIG__.StatsigClient("<CLIENT-SDK-KEY>, {});
const client = new window.Statsig.StatsigClient("<CLIENT-SDK-KEY>, {});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There appears to be a syntax error in the string literal. The closing quotation mark is missing after <CLIENT-SDK-KEY>, and there should be a second parameter object. The correct syntax should be:

const client = new window.Statsig.StatsigClient("<CLIENT-SDK-KEY>", {});

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

const { StatsigClient, runStatsigAutoCapture, runStatsigSessionReplay } = window.Statsig;

const client = new StatsigClient(
'client-rfLvYGag3eyU0jYW5zcIJTQip7GXxSrhOFN69IGMjvq',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For security, please replace 'client-rfLvYGag3eyU0jYW5zcIJTQip7GXxSrhOFN69IGMjvq' with a placeholder like '<CLIENT-SDK-KEY>'. The current value appears to be a real client key which should not be committed to documentation.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

@jasonwzm
Copy link
Member

jasonwzm commented Dec 13, 2024

@jasonwzm jasonwzm temporarily deployed to pull request December 13, 2024 17:39 Inactive
@tore-statsig tore-statsig merged commit 024a8c2 into main Dec 13, 2024
2 checks passed
@tore-statsig tore-statsig deleted the window-statsig branch December 13, 2024 17:41
@jasonwzm jasonwzm temporarily deployed to pull request December 13, 2024 17:43 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants