Classes
Methods
# getBucketForVisitor(buckets, visitorId, redistributeopt, seed=opt) → {string|null}
Get a bucket for the visitor
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
buckets |
object
|
Key-value object with variations IDs as keys and percentages as values | ||
visitorId |
Id
|
|||
redistribute |
number
|
<optional> |
0 | |
seed= |
number
|
<optional> |
string
|
null
# getValueVisitorBased(visitorId, seedopt) → {number}
Get a value based on hash from Visitor id to use for bucket selecting
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
visitorId |
Id
|
||
seed |
number
|
<optional> |
number
# selectBucket(buckets, value, redistributeopt) → {string|null}
Select variation based on its percentages and value provided
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
buckets |
object
|
Key-value object with variations IDs as keys and percentages as values | |
value |
number
|
A bucket value | |
redistribute |
number
|
<optional> |
Defaults to '0' |
string
|
null