Hey all, When setting GrowthBook on a site, I not...
# ask-questions
r
Hey all, When setting GrowthBook on a site, I noticed that my changes are not being applied in my variations. Upon further inspection I see inside of dev tools that when GB makes a request that I get {"status":400,"error":"Invalid API Key"}. I doublechecked and confirmed that I do in fact have the right key, but does anyone know why this may be happening? Also am I correct to assume that this is why my changes are not being applied in preview links and live experiments?
f
hi Caleb
are you using the SDK endpoint?
are you self hosting?
r
Hi @fresh-football-47124, we are self hosting
f
Did you edit the endpoint for the devtools to work with your self hosted GrowthBook? We're launching a new version of this in a few days which should make it easier to switch
r
Yeah I am using the right key with chrome dev tools but the actual SDK key for the script tag isn’t working
f
can you load the SDK url directly? should return a json object
r
I'll try this out and get back to you
Hey @fresh-football-47124 Here is the the response from loading the SDK url directly:
Copy code
{
  "name": "GrowthBook API",
  "production": false,
  "api_host": "<https://cro-lab.novapower.io:3100>",
  "app_origin": "<https://cro-lab.novapower.io>",
  "config_source": "db",
  "email_enabled": false,
  "build": {
    "sha": "dc43008259dafe82b0bf010dd8354ca4da5f62bc",
    "date": "2024-11-26T20:10:05Z",
    "lastVersion": "3.3.0"
  }
}
@fresh-football-47124 could this be due to production being set to false?
f
we add more debugging when production is false
but that is what I would expect. Can you go to the SDK page in GrowthBook, grab the full URL for it, and request it directly? (if you're using the HTML script SDK, you can just go to [your API url]/api/features/[sdk id, ie sdk-1234123]
It appears to be populating
f
okay
and that should update when you make changes to your feature
(getting back to the original question)
does it not?
r
@fresh-football-47124 odd not seeing the API error any longer but my changes don't show up on the page through the preview. Still getting the invalid api key
Screenshot 2025-02-19 at 2.28.45 PM.png
Any changes that I make do not show
f
the API key is set inside GrowthBook, and also requires you set the end point url inside the devtools settings
r
Do you have documentation on this I can check out?
I know there are API keys here but thought that was primarily for the extension
@fresh-football-47124 can I modify the js in the script tag so that it pulls from https://cro-lab.novapower.io:3100/api/features/sdk-mi5ag5DBKS2NYRJN
Hey @fresh-football-47124, provided more context here: https://www.loom.com/share/721b4b9a6ad34ceeb2e5112ef38e2913