<commit_before># samsara-clj-sdk

Clojure SDK for Samsara. [![Circle CI](https://circleci.com/gh/samsara/samsara-clj-sdk/tree/master.svg?style=svg)](https://circleci.com/gh/samsara/samsara-clj-sdk/tree/master)

## Usage

To use the Samasara SDK you need to add the following dependency to your `project.clj` file.

```clojure
[samsara/samsara-client "0.1.0-beta2"]
```
Load the namespace in the REPL
```clojure
(use 'samsara.client)
```
or as part of your namespace
```clojure
(ns my.project
	(:require [samsara.client :as :samsara]))
```
Now you can start to publish events to samsara.

### Publish an Event
Samsara SDK buffers events and publishes them to Ingestion API periodically. To record an event in the Samsara buffer do
```clojure
(samsara/record-event {:eventName "user.logged"})
```
Alternatively, you can publish bulk events immediately to the Ingestion API using the publish-events function.
```clojure
(samsara/publish-events [{:eventName "user.logged"
                          :timestamp 1431261991023
                          :sourceId "e6f01efd-04a9-4c18-a210-2806718b6d43"})]
```
The event will be sent to samsara immediately.<commit_msg>Updated latest version in README<commit_after># samsara-clj-sdk

Clojure SDK for Samsara. [![Circle CI](https://circleci.com/gh/samsara/samsara-clj-sdk/tree/master.svg?style=svg)](https://circleci.com/gh/samsara/samsara-clj-sdk/tree/master)

## Usage

To use the Samasara SDK you need to add the following dependency to your `project.clj` file.

```clojure
[samsara/samsara-client "0.1.1"]
```
Load the namespace in the REPL
```clojure
(use 'samsara.client)
```
or as part of your namespace
```clojure
(ns my.project
	(:require [samsara.client :as :samsara]))
```
Now you can start to publish events to samsara.

### Publish an Event
Samsara SDK buffers events and publishes them to Ingestion API periodically. To record an event in the Samsara buffer do
```clojure
(samsara/record-event {:eventName "user.logged"})
```
Alternatively, you can publish bulk events immediately to the Ingestion API using the publish-events function.
```clojure
(samsara/publish-events [{:eventName "user.logged"
                          :timestamp 1431261991023
                          :sourceId "e6f01efd-04a9-4c18-a210-2806718b6d43"})]
```
The event will be sent to samsara immediately.
{'fraction_non_alphanumeric': 0.11969111969111969, 'fraction_numerical': 0.03303303303303303, 'mean_word_length': 4.025862068965517, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3275429', 'n_tokens_mistral': 868, 'n_tokens_neox': 779, 'n_words': 237}