Skip to content

Commit 73b13b8

Browse files
committed
docs(README): add configurations example
1 parent 199c156 commit 73b13b8

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,38 @@ Client instance requires a set of configurations passed by the `DataArt.Config`
3838
val dataart = DataArt(appContext, DataArt.Config("your-api-key"))
3939
```
4040

41+
You can customize configurations using `DataArt.Config` object:
42+
43+
```kotlin
44+
Config(
45+
/**
46+
* The authorization key for sending requests. You can find this value
47+
* in your dashboard. Contact support if you need help.
48+
*/
49+
val apiKey: String,
50+
/**
51+
* The number of times each request is tried before giving up.
52+
*/
53+
val flushNumRetries: Int = DEFAULT_FLUSH_NUM_RETRIES,
54+
/**
55+
* The constant time (seconds) added for each execution retry. For instance
56+
* a flushNumRetries of 3 and flushBackoffRatio of 10 will cause in 10, 20, 30 seconds
57+
* of delay before giving up.
58+
*/
59+
val flushBackoffRatio: Long = DEFAULT_FLUSH_BACKOFF_RATIO,
60+
/**
61+
* The number of action events in batch request. If you emit
62+
* this much actions, a request will be created and sent.
63+
*/
64+
val flushActionsBatchSize: Int = DEFAULT_FLUSH_ACTIONS_BATCH_SIZE,
65+
/**
66+
* The timer duration (milliseconds) for flushing actions. If this much time is passed
67+
* and there's some actions left, they will be sent to server.
68+
*/
69+
val flushInterval: Long = DEFAULT_FLUSH_INTERVAL
70+
)
71+
```
72+
4173
### Emit Action
4274

4375
```kotlin

0 commit comments

Comments
 (0)