Skip to content

Instantly share code, notes, and snippets.

@RobSpectre
Created December 2, 2024 16:37
Show Gist options
  • Save RobSpectre/207bd8d9047fb94a6fa4784902e4aa04 to your computer and use it in GitHub Desktop.
Save RobSpectre/207bd8d9047fb94a6fa4784902e4aa04 to your computer and use it in GitHub Desktop.
import ldclient
from ldclient.config import Config
from ldclient import Context
ldclient.set_config(Config('sdk-copy-your-key-here'))
client = ldclient.get()
if __name__ == "__main__":
if client.is_initialized():
print("LaunchDarkly is successfully authenticated to your account.")
else:
print("There was an issue authenticating - is the SDK key correct?")
context = Context.builder('user-id-123abc').kind('user').name('Sandy').set('email', '[email protected]').build()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment