This is an Elixir web application example that demonstrates how to use the Split Elixir SDK, which connects to a Splitd daemon instance to evaluate feature flags and track events.
- Download the Splitd daemon for your specific OS and CPU Architecture. For example, to download it for MacOS with Apple Silicon and assuming you have wget CLI tool installed, you can run the following command:
# Download the binary
wget https://github.com/splitio/splitd/releases/download/v1.6.0/splitd-darwin-arm-1.6.0.bin
# Make it executable
chmod +x ./splitd-darwin-arm-1.6.0.bin
NOTE: check here for other download options.
-
Update the
./split.yaml
configuration file with your Split server-side SDK Key. To get your SDK Key, sign in to your Split account, navigate to the "Admin Settings" -> "API Keys" tab, and copy the SDK Key from the "SDK API Keys" section. -
Start the Splitd daemon by running the following command:
SPLITD_CONF_FILE=./splitd.yaml ./splitd-darwin-arm-1.6.0.bin
Prerequisites: install Elixir.
- Install dependencies:
mix deps.get
- Start the Elixir Web application:
mix run --no-halt
- Open your browser and navigate to
http://localhost:8080/feature-flag-names
to see the list of feature flags available in your Split environment.