C Server-Side SDK
LaunchDarkly SDK
client.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <launchdarkly/boolean.h>
9 #include <launchdarkly/config.h>
10 #include <launchdarkly/export.h>
11 #include <launchdarkly/json.h>
12 #include <launchdarkly/user.h>
13 
18 struct LDClient;
19 
31 LD_EXPORT(struct LDClient *)
32 LDClientInit(struct LDConfig *const config, const unsigned int maxwaitmilli);
33 
42 LD_EXPORT(LDBoolean) LDClientClose(struct LDClient *const client);
43 
50 LD_EXPORT(LDBoolean) LDClientIsInitialized(struct LDClient *const client);
51 
63 LD_EXPORT(LDBoolean)
65  struct LDClient *const client,
66  const char *const key,
67  const struct LDUser *const user,
68  struct LDJSON *const data);
69 
82 LD_EXPORT(LDBoolean)
84  struct LDClient *const client,
85  const char *const key,
86  const struct LDUser *const user,
87  struct LDJSON *const data,
88  const double metric);
89 
99 LD_EXPORT(LDBoolean)
101  struct LDClient *const client,
102  const struct LDUser *const currentUser,
103  const struct LDUser *const previousUser);
104 
112 LD_EXPORT(LDBoolean)
114  struct LDClient *const client, const struct LDUser *const user);
115 
121 LD_EXPORT(LDBoolean) LDClientIsOffline(struct LDClient *const client);
122 
128 LD_EXPORT(LDBoolean) LDClientFlush(struct LDClient *const client);
LDClientIsInitialized
LDBoolean LDClientIsInitialized(struct LDClient *const client)
Check if a client has been fully initialized. This may be useful if the initialization timeout was re...
boolean.h
A custom c89 boolean type.
LDClientFlush
LDBoolean LDClientFlush(struct LDClient *const client)
Immediately flushes queued events.
LDClientTrack
LDBoolean LDClientTrack(struct LDClient *const client, const char *const key, const struct LDUser *const user, struct LDJSON *const data)
Reports that a user has performed an event. Custom data can be attached to the event as JSON.
LDClientIdentify
LDBoolean LDClientIdentify(struct LDClient *const client, const struct LDUser *const user)
Generates an identify event for a user, if the user's key is non-empty.
LDClientTrackMetric
LDBoolean LDClientTrackMetric(struct LDClient *const client, const char *const key, const struct LDUser *const user, struct LDJSON *const data, const double metric)
Reports that a user has performed an event. Custom data, and a metric can be attached to the event as...
LD_EXPORT
#define LD_EXPORT(x)
Used to ensure only intended symbols are exported in the binaries.
Definition: export.h:10
LDUser
An opaque user object.
LDClientAlias
LDBoolean LDClientAlias(struct LDClient *const client, const struct LDUser *const currentUser, const struct LDUser *const previousUser)
Record a alias event.
LDClientClose
LDBoolean LDClientClose(struct LDClient *const client)
Shuts down the LaunchDarkly client. This will block until all resources have been freed....
LDConfig
An opaque config object.
user.h
Public API Interface for User construction.
LDClient
An opaque client object.
json.h
Public API Interface for JSON usage.
config.h
Public API for Configuration.
LDClientInit
struct LDClient * LDClientInit(struct LDConfig *const config, const unsigned int maxwaitmilli)
Initialize a new client, and connect to LaunchDarkly. It's important to make LDClient a singleton....
LDClientIsOffline
LDBoolean LDClientIsOffline(struct LDClient *const client)
Whether the LaunchDarkly client is in offline mode.
export.h
Public. Configuration of exported symbols.