This message was deleted.
# ask-questions
w
This message was deleted.
r
I finally got it kind of working, so I'll record what I did here for anyone else. Here are the answers to the three questions I asked: 1. The
GROWTHBOOK_API_HOST
should just be
<https://cdn.growthbook.io/>
. 2. I set the environment variables in my zshrc file. 3. At first I had this as
<http://localhost:3300>
, but that wasn't working properly. I ended up running an ngrok server pointed to port 3300 and that's able to form a connection. A few other things to note that the docs don't specify: • Make sure your SDK connection(s) have the options shown in the image set properly. For the url, I provided my proxy url. • Use the proxy url in your code for the
apiHost
property. The reason I say I kind of got it working is because the SDK connection is complete as seen in my second screenshot, but for some reason, I'm getting false back for all of my feature flags. The problem with the ngrok server though is that it's not letting me view the actual response from the GB API and makes it hard to troubleshoot. If anyone has ideas, please let me know. I might try setting the proxy up in AWS and see if that gets me any other results.
h
Hi Jace, glad you mostly got things working. To chime in on your answers: 1. Correct, GrowthBook Cloud users would set GROWTHBOOK_API_HOST to
<https://cdn.growthbook.io>
(I believe without the trailing slash) 2. .zshrc, which is specific to ZSH, is where you could set a global environment variable across your entire system. If you wanted to set a local variable you'd add a
.env.local
file to the project root (when running the codebase directly, it's in
/packages/apps/proxy/
). However, for deployment you'd need to use whatever provisioning mechanism specific to your vendor to set the env variables. 3. I've had mixed luck running with ngrok, but your mileage may vary. For actual deployments however, you probably wouldn't use any sort of tunneling. 4. Yes, you do need to set your proxy location per SDK Connection if you're using GrowthBook Cloud. 5. Correct, point your SDK endpoints at your own proxy. A rare exception would be if you're running hybrid (i.e. features endpoint pointing to your proxy, streaming endpoint pointing to our CDN).
r
Thanks, Bryce. After looking at your answers and checking everything, I think it just comes down to using ngrok. I was hoping to get the proxy setup locally first, but now I'll just try aws.
137 Views