Hi. this might already have been asked so I'd appr...
# announcements
h
Hi. this might already have been asked so I'd appreciate a link if that is the case. Is there a way to define Features and Experiments in code (like a yaml or even API) and sync that to the Server to be reflected in the UI? .. I am thinking of like having those yamls versioned in github.. This sync could then be triggered on deploy of my new code (creating the new experiments) ,etc
f
Hi Carlo. Our SDKs just need a JSON object passed in with feature definitions. Whether that JSON is created in the GrowthBook UI or hand-crafted and stored in GitHub doesn't matter. It sounds like you may want the GrowthBook App to basically be a read-only UI to view features/experiments, is that right? That's currently not possible, but will be soon with https://github.com/growthbook/growthbook/pull/343
h
Thanks Jeremy sounds great. Do you have an example of the SDK in any language sending json to create new features and experiments ? I navigated a bit the SDK and can't find the right place I think
f
The SDKs don't create features/experiments. You pass in feature definitions as a JSON object and the SDK just evaluates them for a user and assigns a value.
A feature definitions JSON might look like this:
Copy code
{
  "my-feature": {
    "defaultValue": false,
    "rules": [
      {
        "condition": {
          "country": {
            "$in": [
              "US",
              "CA"
            ]
          }
        },
        "force": true
      }
    ]
  }
}