This message was deleted.
# ask-questions
w
This message was deleted.
f
Webflow is tricky
the visual editor can work, or coding cases with JS
b
What would the best way to implement the SDK be? I'm having trouble getting it to read as connected, but may be doing the setup incorrectly. Thanks!!
f
ya, it may not be able to detect that - did you select client side JS?
b
yes, client side JS
is there another way of getting it to work?
f
it may be working even though its not detected - that detection thing is for real time connections which is in beta atm
b
ah ok! thanks so much Graham. does that go for the DevTools Chrome extension as well?
as that's also erroring and saying no instance is detected
f
how are you adding the SDK?
b
here is the code we are using:
Copy code
<script src="<https://cdn.jsdelivr.net/npm/@growthbook/growthbook/dist/bundles/index.js>"></script>
<script>
  document.addEventListener('DOMContentLoaded', function() {
    // Create a GrowthBook instance
    var gb = new growthbook.GrowthBook({
      apiHost: "<https://cdn.growthbook.io>",
      clientKey: "sdk-1234",
      enableDevMode: true,
      trackingCallback: function(experiment, result) {
        console.log("Experiment Viewed", {
          experimentId: experiment.key,
          variationId: result.key,
        });
      },
    });

    // Wait for features to be available
    await gb.loadFeatures({ autoRefresh: true });
  });
</script>
f
is the site pubilc? you can DM me and I can check if its working
Copy code
var gb = new growthbook.GrowthBook({
is not right
should be
Copy code
var gb = new GrowthBook({
148 Views