(autotunes)
- create - Create Autotune
- list - List Autotune
- read - Read Autotune
- partialUpdate - Partially Update Autotune
- fullUpdate - Fully Update Autotune
- delete - Delete Autotune
- start - Start Autotune Experiment
- makeDecision - Finish Experiment Early
- reset - Reset Experiment
Create Autotune
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.autotunes.create({
autotuneCreateDto: {
variants: [
{
name: "<value>",
json: "<value>",
},
],
successEvent: "<value>",
explorationWindow: "24",
attributionWindow: "2hrs",
winnerThreshold: "98%",
name: "<value>",
},
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { autotunesCreate } from "statsig/funcs/autotunesCreate.js";
// Use `StatsigCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const statsig = new StatsigCore({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await autotunesCreate(statsig, {
autotuneCreateDto: {
variants: [
{
name: "<value>",
json: "<value>",
},
],
successEvent: "<value>",
explorationWindow: "24hr",
attributionWindow: "2",
winnerThreshold: "80%",
name: "<value>",
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ConsoleV1AutotunesControllerGenCreateRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.ConsoleV1AutotunesControllerGenCreateResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.ConsoleV1AutotunesControllerGenCreateResponseBody | 400 | application/json |
errors.ConsoleV1AutotunesControllerGenCreateAutotunesResponseBody | 401 | application/json |
errors.SDKError | 4xx-5xx | / |
List Autotune
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.autotunes.list({
limit: 10,
page: 1,
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { autotunesList } from "statsig/funcs/autotunesList.js";
// Use `StatsigCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const statsig = new StatsigCore({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await autotunesList(statsig, {
limit: 10,
page: 1,
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ConsoleV1AutotunesControllerGenListRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.ConsoleV1AutotunesControllerGenListResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Read Autotune
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.autotunes.read({
id: "<id>",
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { autotunesRead } from "statsig/funcs/autotunesRead.js";
// Use `StatsigCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const statsig = new StatsigCore({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await autotunesRead(statsig, {
id: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ConsoleV1AutotunesControllerGenReadRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.ConsoleV1AutotunesControllerGenReadResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.ConsoleV1AutotunesControllerGenReadResponseBody | 401 | application/json |
errors.ConsoleV1AutotunesControllerGenReadAutotunesResponseBody | 404 | application/json |
errors.SDKError | 4xx-5xx | / |
Update selected properties of the experiment
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.autotunes.partialUpdate({
id: "<id>",
autotunePartialUpdateDto: {},
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { autotunesPartialUpdate } from "statsig/funcs/autotunesPartialUpdate.js";
// Use `StatsigCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const statsig = new StatsigCore({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await autotunesPartialUpdate(statsig, {
id: "<id>",
autotunePartialUpdateDto: {},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ConsoleV1AutotunesControllerGenPartialUpdateRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.ConsoleV1AutotunesControllerGenPartialUpdateResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.ConsoleV1AutotunesControllerGenPartialUpdateResponseBody | 400 | application/json |
errors.ConsoleV1AutotunesControllerGenPartialUpdateAutotunesResponseBody | 401 | application/json |
errors.ConsoleV1AutotunesControllerGenPartialUpdateAutotunesResponseResponseBody | 404 | application/json |
errors.SDKError | 4xx-5xx | / |
Update all properties of the experiment
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.autotunes.fullUpdate({
id: "<id>",
autotuneFullUpdateDto: {
description: "helpful summary of what this Autotune is",
variants: [
{
name: "red",
json: {
"foo": "boo",
},
},
{
name: "blue",
json: {
},
},
],
successEvent: "purchase_item",
successEventValue: "",
explorationWindow: "1hr",
attributionWindow: "2hrs",
winnerThreshold: "99%",
},
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { autotunesFullUpdate } from "statsig/funcs/autotunesFullUpdate.js";
// Use `StatsigCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const statsig = new StatsigCore({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await autotunesFullUpdate(statsig, {
id: "<id>",
autotuneFullUpdateDto: {
description: "helpful summary of what this Autotune is",
variants: [
{
name: "red",
json: {
"foo": "boo",
},
},
{
name: "blue",
json: {
},
},
],
successEvent: "purchase_item",
successEventValue: "",
explorationWindow: "1hr",
attributionWindow: "2hrs",
winnerThreshold: "99%",
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ConsoleV1AutotunesControllerGenFullUpdateRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.ConsoleV1AutotunesControllerGenFullUpdateResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.ConsoleV1AutotunesControllerGenFullUpdateResponseBody | 401 | application/json |
errors.ConsoleV1AutotunesControllerGenFullUpdateAutotunesResponseBody | 404 | application/json |
errors.SDKError | 4xx-5xx | / |
Delete Autotune
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.autotunes.delete({
id: "<id>",
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { autotunesDelete } from "statsig/funcs/autotunesDelete.js";
// Use `StatsigCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const statsig = new StatsigCore({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await autotunesDelete(statsig, {
id: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ConsoleV1AutotunesControllerGenRemoveRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.ConsoleV1AutotunesControllerGenRemoveResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.ConsoleV1AutotunesControllerGenRemoveResponseBody | 401 | application/json |
errors.ConsoleV1AutotunesControllerGenRemoveAutotunesResponseBody | 404 | application/json |
errors.SDKError | 4xx-5xx | / |
Start Autotune Experiment
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.autotunes.start({
id: "<id>",
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { autotunesStart } from "statsig/funcs/autotunesStart.js";
// Use `StatsigCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const statsig = new StatsigCore({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await autotunesStart(statsig, {
id: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ConsoleV1AutotunesControllerGenStartRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.ConsoleV1AutotunesControllerGenStartResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Finish Experiment Early
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.autotunes.makeDecision({
id: "<id>",
experimentStatusUpdateDto: {
id: "experiment123",
decisionReason: "Your reason for stopping early",
removeTargeting: false,
},
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { autotunesMakeDecision } from "statsig/funcs/autotunesMakeDecision.js";
// Use `StatsigCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const statsig = new StatsigCore({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await autotunesMakeDecision(statsig, {
id: "<id>",
experimentStatusUpdateDto: {
id: "experiment123",
decisionReason: "Your reason for stopping early",
removeTargeting: false,
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ConsoleV1AutotunesControllerGenMakeDecisionRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.ConsoleV1AutotunesControllerGenMakeDecisionResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.ConsoleV1AutotunesControllerGenMakeDecisionResponseBody | 400 | application/json |
errors.ConsoleV1AutotunesControllerGenMakeDecisionAutotunesResponseBody | 401 | application/json |
errors.ConsoleV1AutotunesControllerGenMakeDecisionAutotunesResponseResponseBody | 404 | application/json |
errors.SDKError | 4xx-5xx | / |
Reset Experiment
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.autotunes.reset({
id: "<id>",
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { autotunesReset } from "statsig/funcs/autotunesReset.js";
// Use `StatsigCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const statsig = new StatsigCore({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await autotunesReset(statsig, {
id: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ConsoleV1AutotunesControllerGenResetRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.ConsoleV1AutotunesControllerGenResetResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.ConsoleV1AutotunesControllerGenResetResponseBody | 400 | application/json |
errors.ConsoleV1AutotunesControllerGenResetAutotunesResponseBody | 401 | application/json |
errors.ConsoleV1AutotunesControllerGenResetAutotunesResponseResponseBody | 404 | application/json |
errors.SDKError | 4xx-5xx | / |