mint-metrics / mojito-js-delivery

🧪 Source-controlled JS split testing framework for building and launching A/B tests.
https://mojito.mx/docs/js-delivery-intro
Other
16 stars 30 forks source link

Server-side/App config: Option to produce JSON output of test config #83

Open kingo55 opened 4 years ago

kingo55 commented 4 years ago

If we want to run experiments server-side or through an app, we need a way to share the experiment configuration. Publishing the configuration through JSON seems the most plausible way for accessing test config through an App/Server-side SDK.

[
  {
    "state": "live",
    "sampleRate": 1,
    "id": "ex1",
    "name": "test name",
    "recipes": {
      "0": {
        "name": "Control"
      },
      "1": {
        "name": "Treatment"
      }
    },
    "trigger": "something",
    "divertTo": "1"
  }, {
    "state": "live",
    "sampleRate": 1,
    "id": "ex2",
    "name": "another test",
    "recipes": {
      "0": {
        "name": "Control"
      },
      "1": {
        "name": "Treatment"
      }
    },
    "trigger": "something",
    "divertTo": "1"
  }, {
    "state": "staging",
    "sampleRate": 0,
    "id": "ex3",
    "name": "Next test",
    "recipes": {
      "0": {
        "name": "Control"
      },
      "1": {
        "name": "Treatment"
      }
    },
    "trigger": "something"
  }, {
    "state": "live",
    "sampleRate": 1,
    "id": "ex4",
    "name": "Test 4",
    "recipes": {
      "0": {
        "name": "Control"
      },
      "1": {
        "name": "Treatment"
      }
    },
    "trigger": "something",
    "divertTo": "1"
  }
]

Using JSON would mean we could focus on improving the one codebase for apps/web etc. Just a thought.