Important
Please see Lua Server SDK for the most up-to-date hello-lua-server
. This repo is deprecated.
We've built a simple console application that demonstrates how LaunchDarkly's SDK works. Below, you'll find the build procedure. For more comprehensive instructions, you can visit your Quickstart page or the Lua reference guide.
You will need the shared library for the LaunchDarkly c-server-sdk
. You can automatically download the lua-server-sdk
and c-server-sdk
with download.sh
. The c-server-sdk
shared library must be accessible by the linker at run time. This project is built with luarocks
.
The download.sh
script is not suitable for a production or CI environment.
- Install the dependencies described above.
- Edit hello.lua and set the value of YOUR_SDK_KEY to your LaunchDarkly SDK key. If there is an existing boolean feature flag in your LaunchDarkly project that you want to evaluate, set YOUR_FEATURE_KEY to the flag key.
local YOUR_SDK_KEY = "1234567890abcdef"
local YOUR_FEATURE_KEY = "my-boolean-flag"
- On the command line, build the SDK with
sudo luarocks make launchdarkly-server-sdk-1.0-0.rockspec LD_DIR=. LD_INCDIR=./include
. - On the command line, run
LD_LIBRARY_PATH=. luajit hello.lua
orLD_LIBRARY_PATH=. lua hello.lua
.