(dynamicConfigs)
- create - Create Dynamic Config
- list - List Dynamic Configs
- get - Get Dynamic Config
- updatePartial - Partially Update Dynamic Config
- updateFull - Fully Update Dynamic Config
- delete - Delete Dynamic Config
- getRules - Get Dynamic Config Rules
- addRules - Add Dynamic Config Rules
- updateRules - Update List of Dynamic Config Rules
- getRule - Get Specific Dynamic Config Rule
- updateRule - Update Dynamic Config Rule
- deleteRule - Delete Dynamic Config Rule
- disable - Disable Dynamic Config
- enable - Enable Dynamic Config
- addRule - Add Dynamic Config Rule
Create Dynamic Config
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.dynamicConfigs.create({
dynamicConfigCreateDto: {
idType: "userID",
name: "<value>",
},
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { dynamicConfigsCreate } from "statsig/funcs/dynamicConfigsCreate.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 dynamicConfigsCreate(statsig, {
dynamicConfigCreateDto: {
idType: "userID",
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.ConsoleV1DynamicConfigControllerGenCreateRequest | ✔️ | 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.ConsoleV1DynamicConfigControllerGenCreateResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.ConsoleV1DynamicConfigControllerGenCreateResponseBody | 400 | application/json |
errors.ConsoleV1DynamicConfigControllerGenCreateDynamicConfigsResponseBody | 401 | application/json |
errors.ConsoleV1DynamicConfigControllerGenCreateDynamicConfigsResponseResponseBody | 403 | application/json |
errors.SDKError | 4xx-5xx | / |
List Dynamic Configs
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.dynamicConfigs.list({
tags: {
"singleTag": {
"value": "tag1",
},
"multipleTags": {
"value": [
"tag1",
"tag2",
],
},
},
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 { dynamicConfigsList } from "statsig/funcs/dynamicConfigsList.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 dynamicConfigsList(statsig, {
tags: {
"singleTag": {
"value": "tag1",
},
"multipleTags": {
"value": [
"tag1",
"tag2",
],
},
},
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.ConsoleV1DynamicConfigControllerGenListRequest | ✔️ | 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.ConsoleV1DynamicConfigControllerGenListResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.ConsoleV1DynamicConfigControllerGenListResponseBody | 404 | application/json |
errors.SDKError | 4xx-5xx | / |
Get Dynamic Config
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.dynamicConfigs.get({
id: "<id>",
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { dynamicConfigsGet } from "statsig/funcs/dynamicConfigsGet.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 dynamicConfigsGet(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.ConsoleV1DynamicConfigControllerGenReadRequest | ✔️ | 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.ConsoleV1DynamicConfigControllerGenReadResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.ConsoleV1DynamicConfigControllerGenReadResponseBody | 401 | application/json |
errors.ConsoleV1DynamicConfigControllerGenReadDynamicConfigsResponseBody | 404 | application/json |
errors.SDKError | 4xx-5xx | / |
Partially Update Dynamic Config
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.dynamicConfigs.updatePartial({
id: "<id>",
dynamicConfigPartialUpdateDto: {
description: "helpful summary of what this dynamic config does",
idType: "userID",
tags: [
"a tag",
],
},
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { dynamicConfigsUpdatePartial } from "statsig/funcs/dynamicConfigsUpdatePartial.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 dynamicConfigsUpdatePartial(statsig, {
id: "<id>",
dynamicConfigPartialUpdateDto: {
description: "helpful summary of what this dynamic config does",
idType: "userID",
tags: [
"a tag",
],
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ConsoleV1DynamicConfigControllerGenPartialUpdateRequest | ✔️ | 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.ConsoleV1DynamicConfigControllerGenPartialUpdateResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.ConsoleV1DynamicConfigControllerGenPartialUpdateResponseBody | 401 | application/json |
errors.ConsoleV1DynamicConfigControllerGenPartialUpdateDynamicConfigsResponseBody | 404 | application/json |
errors.SDKError | 4xx-5xx | / |
Fully Update Dynamic Config
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.dynamicConfigs.updateFull({
id: "<id>",
dynamicConfigFullUpdateDto: {
description: "helpful summary of what this dynamic config does",
rules: [
{
name: "<value>",
passPercentage: 6693.63,
conditions: [
{
type: "fails_gate",
},
],
},
],
idType: "userID",
tags: [
"a tag",
],
},
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { dynamicConfigsUpdateFull } from "statsig/funcs/dynamicConfigsUpdateFull.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 dynamicConfigsUpdateFull(statsig, {
id: "<id>",
dynamicConfigFullUpdateDto: {
description: "helpful summary of what this dynamic config does",
rules: [
{
name: "<value>",
passPercentage: 2413.36,
conditions: [
{
type: "environment_tier",
},
],
},
],
idType: "userID",
tags: [
"a tag",
],
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ConsoleV1DynamicConfigControllerGenFullUpdateRequest | ✔️ | 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.ConsoleV1DynamicConfigControllerGenFullUpdateResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.ConsoleV1DynamicConfigControllerGenFullUpdateResponseBody | 400 | application/json |
errors.ConsoleV1DynamicConfigControllerGenFullUpdateDynamicConfigsResponseBody | 401 | application/json |
errors.ConsoleV1DynamicConfigControllerGenFullUpdateDynamicConfigsResponseResponseBody | 403 | application/json |
errors.SDKError | 4xx-5xx | / |
Delete Dynamic Config
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.dynamicConfigs.delete({
id: "<id>",
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { dynamicConfigsDelete } from "statsig/funcs/dynamicConfigsDelete.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 dynamicConfigsDelete(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.ConsoleV1DynamicConfigControllerGenRemoveRequest | ✔️ | 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.ConsoleV1DynamicConfigControllerGenRemoveResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.ConsoleV1DynamicConfigControllerGenRemoveResponseBody | 401 | application/json |
errors.ConsoleV1DynamicConfigControllerGenRemoveDynamicConfigsResponseBody | 404 | application/json |
errors.SDKError | 4xx-5xx | / |
Get Dynamic Config Rules
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.dynamicConfigs.getRules({
id: "<id>",
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { dynamicConfigsGetRules } from "statsig/funcs/dynamicConfigsGetRules.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 dynamicConfigsGetRules(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.ConsoleV1DynamicConfigControllerGenReadRulesRequest | ✔️ | 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.ConsoleV1DynamicConfigControllerGenReadRulesResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Add Dynamic Config Rules
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.dynamicConfigs.addRules({
id: "<id>",
multiDynamicConfigRuleAddDto: {
rules: [
{
name: "<value>",
passPercentage: 8990.96,
conditions: [
{
type: "passes_gate",
},
],
},
],
},
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { dynamicConfigsAddRules } from "statsig/funcs/dynamicConfigsAddRules.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 dynamicConfigsAddRules(statsig, {
id: "<id>",
multiDynamicConfigRuleAddDto: {
rules: [
{
name: "<value>",
passPercentage: 7545.19,
conditions: [
{
type: "browser_name",
},
],
},
],
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ConsoleV1DynamicConfigControllerGenMultiRuleAddRequest | ✔️ | 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.ConsoleV1DynamicConfigControllerGenMultiRuleAddResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Update List of Dynamic Config Rules
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.dynamicConfigs.updateRules({
id: "<id>",
multiRuleUpdateDto: {
rules: [
{
name: "All Conditions",
passPercentage: 10,
conditions: [
{
targetValue: [
0,
],
operator: "any",
field: "string",
customID: "string",
type: "user_id",
},
],
environments: [
"string",
],
id: "38ttpCpzrQFTMKcqFKk02l:10.00:1",
baseID: "38ttpCpzrQFTMKcqFKk02l",
},
],
},
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { dynamicConfigsUpdateRules } from "statsig/funcs/dynamicConfigsUpdateRules.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 dynamicConfigsUpdateRules(statsig, {
id: "<id>",
multiRuleUpdateDto: {
rules: [
{
name: "All Conditions",
passPercentage: 10,
conditions: [
{
targetValue: [
"0",
],
operator: "any",
field: "string",
customID: "string",
type: "user_id",
},
],
environments: [
"string",
],
id: "38ttpCpzrQFTMKcqFKk02l:10.00:1",
baseID: "38ttpCpzrQFTMKcqFKk02l",
},
],
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ConsoleV1DynamicConfigControllerGenMultiRuleUpdateRequest | ✔️ | 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.ConsoleV1DynamicConfigControllerGenMultiRuleUpdateResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Get Specific Dynamic Config Rule
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.dynamicConfigs.getRule({
id: "<id>",
ruleId: "<value>",
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { dynamicConfigsGetRule } from "statsig/funcs/dynamicConfigsGetRule.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 dynamicConfigsGetRule(statsig, {
id: "<id>",
ruleId: "<value>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ConsoleV1DynamicConfigControllerGenReadRuleRequest | ✔️ | 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.ConsoleV1DynamicConfigControllerGenReadRuleResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Update Dynamic Config Rule
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.dynamicConfigs.updateRule({
id: "<id>",
ruleId: "<value>",
ruleUpdateDto: {
name: "All Conditions",
passPercentage: 10,
conditions: [
{
targetValue: "[\"35sClJFs8l0y5uRQhDwUDo\"]",
operator: "any",
type: "user_id",
},
],
environments: [
"staging",
],
id: "38ttpCpzrQFTMKcqFKk02l:10.00:1",
baseID: "38ttpCpzrQFTMKcqFKk02l",
},
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { dynamicConfigsUpdateRule } from "statsig/funcs/dynamicConfigsUpdateRule.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 dynamicConfigsUpdateRule(statsig, {
id: "<id>",
ruleId: "<value>",
ruleUpdateDto: {
name: "All Conditions",
passPercentage: 10,
conditions: [
{
targetValue: 35sClJFs8l0y5uRQhDwUDo,
operator: "any",
type: "user_id",
},
],
environments: [
"staging",
],
id: "38ttpCpzrQFTMKcqFKk02l:10.00:1",
baseID: "38ttpCpzrQFTMKcqFKk02l",
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ConsoleV1DynamicConfigControllerGenRuleUpdateRequest | ✔️ | 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.ConsoleV1DynamicConfigControllerGenRuleUpdateResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Delete Dynamic Config Rule
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.dynamicConfigs.deleteRule({
id: "<id>",
ruleId: "<value>",
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { dynamicConfigsDeleteRule } from "statsig/funcs/dynamicConfigsDeleteRule.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 dynamicConfigsDeleteRule(statsig, {
id: "<id>",
ruleId: "<value>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ConsoleV1DynamicConfigControllerGenRuleDeleteRequest | ✔️ | 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.ConsoleV1DynamicConfigControllerGenRuleDeleteResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Disable Dynamic Config
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.dynamicConfigs.disable({
id: "<id>",
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { dynamicConfigsDisable } from "statsig/funcs/dynamicConfigsDisable.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 dynamicConfigsDisable(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.ConsoleV1DynamicConfigControllerGenDisableRequest | ✔️ | 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.ConsoleV1DynamicConfigControllerGenDisableResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Enable Dynamic Config
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.dynamicConfigs.enable({
id: "<id>",
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { dynamicConfigsEnable } from "statsig/funcs/dynamicConfigsEnable.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 dynamicConfigsEnable(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.ConsoleV1DynamicConfigControllerGenEnableRequest | ✔️ | 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.ConsoleV1DynamicConfigControllerGenEnableResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Add Dynamic Config Rule
import { Statsig } from "statsig";
const statsig = new Statsig({
statsigApiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await statsig.dynamicConfigs.addRule({
id: "<id>",
dynamicConfigRuleAddDto: {
name: "<value>",
passPercentage: 9050.54,
conditions: [
{
type: "time",
},
],
},
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { StatsigCore } from "statsig/core.js";
import { dynamicConfigsAddRule } from "statsig/funcs/dynamicConfigsAddRule.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 dynamicConfigsAddRule(statsig, {
id: "<id>",
dynamicConfigRuleAddDto: {
name: "<value>",
passPercentage: 8690.57,
conditions: [
{
type: "fails_segment",
},
],
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ConsoleV1DynamicConfigControllerGenRuleAddRequest | ✔️ | 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.ConsoleV1DynamicConfigControllerGenRuleAddResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |