https://www.growthbook.io/ logo
b

brash-stone-46387

03/29/2023, 1:16 AM
Hi there! I'm following the steps in https://docs.growthbook.io/tools/cli The auth seems successful as it returns
The GrowthBook config has been written at ~/.growthbook/config.toml
But running the line to generate types returns an Unauthorised error:
There was an error fetching the featuresError: Cannot fetch: Unauthorized
Did anyone experience the same?
f

future-teacher-7046

03/29/2023, 1:22 AM
Hi Boris. Are you self-hosting or using GrowthBook Cloud?
b

brash-stone-46387

03/29/2023, 1:24 AM
Self hosting
Is there a way to point it to the instance?
f

future-teacher-7046

03/29/2023, 1:26 AM
Yeah, when you generate features, we use GrowthBook Cloud by default. You can override the host with the
--apiBaseUrl
flag. For example:
Copy code
growthbook features generate-types --apiBaseUrl <http://localhost:3100> --output ./types
Looking at this now, we should really move the API Base URL into the login command. No reason to make you enter it every time. I'll add an issue in GitHub for this
b

brash-stone-46387

03/29/2023, 1:38 AM
Thanks mate, it worked