white-state-74924
04/04/2023, 3:56 PMApp.js
file but I have a redux reducer where I'm attempting to setAttributes on a user any time an update happens to the user within our application. I have a few questions...
• Is this possible? The reason I'm doing this is we have some features which are enabled for certain groups of people. ie. internal features only enabled for users with certain emails/company information on their client data.
• When i set the attributes they dont get updated on the attributes screen here https://app.growthbook.io/attributes is there something I'm doing wrong?
• The Chrome plugin for Growthbook doesn't seem to be working, do I need any setup in order to get this going?
• Is there somewhere that I can have a development SDK key and a production SDK key, reason being for testing tickets in a development environment with flags and then passing them through or duplicating them into prod.
• I'd love to move to a paid plan but can I trial this first?
Appreciate the help in advance!
Here's the code I'm using in the reducer in order to try and set the client attributes.
reducers: {
setClientData: (state, action) => {
console.log("Updating growthbook data with", action.payload)
growthbook.setAttributes({
"id": fire.auth().currentUser.uid,
...action.payload,
});
state.data = action.payload;
},
} ...
better-magician-65629
04/04/2023, 5:47 PMstate.data = action.payload
looks like where there's an issue. i'm not sure if it's the only issue, but that's one that immediately glares out. you can see the redux docs for more info: https://redux.js.org/tutorials/fundamentals/part-3-state-actions-reducers#reducers-and-immutable-updates
they suggest something like this instead:
function reducer(state, action) {
switch (action.type) {
case 'update_user':
return {
...state,
data: action.payload
}
default:
return state
}
}
better-magician-65629
04/04/2023, 5:52 PMbetter-magician-65629
04/04/2023, 5:59 PM{ country: 'mexico' }
as part of the attributes when calling setAttributes, e.g. growthbook.setAttributes({ id: 'abc-123', country: 'mexico' })
so that these values can be read by the SDK and considered when evaluating features for users. calling setAttributes in the SDK will not update the dashboard. it's used to say "this is my current user and these are the attributes they have" and their attributes will be considered when evaluating a feature. in the below screenshots i have a country user attribute i've specified in the /attributes section of the dashboard, then it shows up under the targeting conditions dropdown for me to build my targeting conditions.white-state-74924
04/05/2023, 7:46 AMwhite-state-74924
04/05/2023, 9:30 AMswift-helmet-3648
04/05/2023, 1:17 PMwhite-state-74924
04/05/2023, 2:02 PMbetter-magician-65629
04/05/2023, 5:24 PMOpen source platform for stress free deployments, measured impact, and smarter decisions.
Powered by