diff --git a/README.md b/README.md index a4f3e5e6..653ae36b 100644 --- a/README.md +++ b/README.md @@ -91,12 +91,15 @@ let messageValue = messageFlag.value ### Tracking events The Confidence instance offers APIs to track events, which are uploaded to the Confidence backend: ```swift -confidence.track(eventName: "MyEvent", data: ["field": ConfidenceValue(string("value"))]) +try confidence.track(eventName: "MyEvent", data: ["field": ConfidenceValue(string("value"))]) ``` The SDK takes care of storing events in case of offline and retries in case of transient failures. -It's also possible to set context data to be appended to all tracked events: +Note that the data struct can't contain the key `context`, as that is reserved for entries set via `putContext` (see below): +violating this rule will cause the track function to throw an error. + +To set context data to be appended to all tracked events: ```swift confidence.putContext(context: ["os_version": ConfidenceValue(string: "17.0")]) ```