@wizeline/optimizely-sync
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

Optimizely Sync

Infrustructure as code for your Optimizely configuration.

Getting started

  1. Install as a devDependency:

    npm i --save-dev @wizeline/optimizely-sync
  2. Create your configuration. This can either be done in a single JSON file or in a directory of JSON files:

    • A single JSON file: config.json

      {
        "development": {
          "feature-one": 10000,
          "other-feature": 10000
        },
        "production": {
          "feature-one": 0,
          "other-feature": 10000
        }
      }
    • A directory of JSON files, where each file is the key of an environment:

      config/development.json

      {
        "created-by-js": 10000,
        "feature-one": 10000,
        "other-feature": 10000
      }

      config/production.json

      {
        "created-by-js": 0,
        "feature-one": 0,
        "other-feature": 10000
      }

      Note: This option allows you to control who can edit configuration for various environments via a CODEOWNERS file.

  3. Create an Optimizely Personal Token.

  4. Run npx optimizely-sync -d config/ -p 12345678901 -t "your-token-here" --dry-run

CLI Flags

Flag Description
--dry-run Log what would be done
-c <path> or
--config-file <path>
The path to the file that contains your desired configuration.
-d <path> or
--config-dir <path>
The path to the directory that contains json files with your desired configurations.
-p <projectId> or
--project-id <projectId>
The id of the Optimizely project. Can also be set via the OPTIMIZELY_PROJECT_ID environment variable.
-t <token> or
--access-token <token>
An Optimizely Personal Access Token. Can also be set via the OPTIMIZELY_ACCESS_TOKEN environment variable.
-h or
--help
display help for command

TODO

  • [ ] Improve README
  • [ ] Add tests
  • [ ] Add support for creating/deleting environments

Package Sidebar

Install

npm i @wizeline/optimizely-sync

Weekly Downloads

3

Version

1.2.0

License

ISC

Unpacked Size

33.2 kB

Total Files

25

Last publish

Collaborators

  • m14t