https://github.com/splitio/split-electron
Example of integrating Split JS and node.js SDK in an Electron app.
https://github.com/splitio/split-electron
Last synced: 3 months ago
JSON representation
Example of integrating Split JS and node.js SDK in an Electron app.
- Host: GitHub
- URL: https://github.com/splitio/split-electron
- Owner: splitio
- Created: 2023-07-20T16:15:58.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-20T16:34:04.000Z (over 2 years ago)
- Last Synced: 2024-12-21T14:38:30.495Z (about 1 year ago)
- Language: JavaScript
- Size: 16.6 KB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# split-electron-app
This is a simple example of Split in an Electron app.
Use the node.js SDK in preload.js to bring in the correct treatment without flicker.
Use JS SDK in index.html to hook the SDK_UPDATE event and change the display in response to feature flag changes.
You will need to find client and server-side API keys to put into the samples. Create a multivariant_demo feature flag and use the Syntax menu item to generate JavaScript and node.js example; the API keys are included in the example.
- The multivariant_demo split mentioned has red, green, blue treatments and the following dynamic config:
Create a feature flag called multivariant_demo. You can cut-and-paste the JSON into the red, green, and blue treatments.
```
red: {"text":"Bring a Cute Dog Home","image":"http://www.cortazar-split.com/dog_by_the_door.jpeg","image_width":"100%"}
blue: {"text":"Adopt a Cute Dog","image":"http://www.cortazar-split.com/dog_origin.jpeg","image_width":"100%"}
green: {"text":"This pet is chillin'","image":"http://www.cortazar-split.com/dog_on_the_couch.jpeg","image_width":"100%"}
```