nice-memory-78462
10/01/2025, 7:00 AMfalse, and the feature list is empty. However, if we check the API directly from the GrowthBook dashboard, we can see that the features are available, and the feature flag FF should return true.
Here’s the snippet of our code:
routes.get('/test-ff', authMiddleware.closedAuth, async (req: any, res) => {
const gb = new GrowthBook({
apiHost: process.env.GROWTHBOOK_API_HOST,
clientKey: process.env.GROWTHBOOK_CLIENT_KEY,
enableDevMode: true,
subscribeToChanges: true,
attributes: {
id: '123',
country: 'US',
},
trackingCallback: (experiment: any, result: any) => {
console.log('Experiment Viewed', {
experimentId: experiment.key,
variationId: result.key,
});
},
});
try {
await gb.init();
} catch (error) {
console.log('Error', error);
}
if (gb.isOn('FF')) {
res.send('Feature is enabled!');
} else {
res.send('Feature is disabled');
}
});
Do we need additional configuration for self-hosted GrowthBook in order for the SDK to fetch the features? Or is there something we might have missed
here response from api (SDK Connection) on dashboard
{
"status": 200,
"features": {
"FF": {
"defaultValue": true
}
},
"experiments": [],
"dateUpdated": "2025-10-01T07:14:23.643Z"
}strong-mouse-55694
10/01/2025, 3:47 PMgb after init and see what the values are there. Also, if the endpoint can't be reached for some reason, gb.init() won't throw an error. So, if it's not connecting in that try/catch, you won't actually see anything. Instead, you need to handle the response: const initRes = await gb.init();nice-memory-78462
10/02/2025, 2:21 AM