Skip to content

Latest commit

 

History

History
1313 lines (936 loc) · 95.6 KB

README.md

File metadata and controls

1313 lines (936 loc) · 95.6 KB

EdgeConfig

(edgeConfig)

Overview

Available Operations

getEdgeConfigs

Returns all Edge Configs.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.edgeConfig.getEdgeConfigs({});

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { edgeConfigGetEdgeConfigs } from "@vercel/sdk/funcs/edgeConfigGetEdgeConfigs.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await edgeConfigGetEdgeConfigs(vercel, {});

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request models.GetEdgeConfigsRequest ✔️ 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.

Response

Promise<models.GetEdgeConfigsResponseBody[]>

Errors

Error Type Status Code Content Type
models.VercelBadRequestError 400 application/json
models.VercelForbiddenError 401 application/json
models.SDKError 4XX, 5XX */*

createEdgeConfig

Creates an Edge Config.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.edgeConfig.createEdgeConfig({
    requestBody: {
      slug: "<value>",
    },
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { edgeConfigCreateEdgeConfig } from "@vercel/sdk/funcs/edgeConfigCreateEdgeConfig.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await edgeConfigCreateEdgeConfig(vercel, {
    requestBody: {
      slug: "<value>",
    },
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request models.CreateEdgeConfigRequest ✔️ 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.

Response

Promise<models.CreateEdgeConfigResponseBody>

Errors

Error Type Status Code Content Type
models.VercelBadRequestError 400 application/json
models.VercelForbiddenError 401 application/json
models.SDKError 4XX, 5XX */*

getEdgeConfig

Returns an Edge Config.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.edgeConfig.getEdgeConfig({
    edgeConfigId: "<id>",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { edgeConfigGetEdgeConfig } from "@vercel/sdk/funcs/edgeConfigGetEdgeConfig.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await edgeConfigGetEdgeConfig(vercel, {
    edgeConfigId: "<id>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request models.GetEdgeConfigRequest ✔️ 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.

Response

Promise<models.GetEdgeConfigResponseBody>

Errors

Error Type Status Code Content Type
models.VercelBadRequestError 400 application/json
models.VercelForbiddenError 401 application/json
models.VercelNotFoundError 404 application/json
models.SDKError 4XX, 5XX */*

updateEdgeConfig

Updates an Edge Config.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.edgeConfig.updateEdgeConfig({
    edgeConfigId: "<id>",
    requestBody: {
      slug: "<value>",
    },
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { edgeConfigUpdateEdgeConfig } from "@vercel/sdk/funcs/edgeConfigUpdateEdgeConfig.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await edgeConfigUpdateEdgeConfig(vercel, {
    edgeConfigId: "<id>",
    requestBody: {
      slug: "<value>",
    },
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request models.UpdateEdgeConfigRequest ✔️ 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.

Response

Promise<models.UpdateEdgeConfigResponseBody>

Errors

Error Type Status Code Content Type
models.VercelBadRequestError 400 application/json
models.VercelForbiddenError 401 application/json
models.VercelNotFoundError 404 application/json
models.SDKError 4XX, 5XX */*

deleteEdgeConfig

Delete an Edge Config by id.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  await vercel.edgeConfig.deleteEdgeConfig({
    edgeConfigId: "<id>",
  });


}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { edgeConfigDeleteEdgeConfig } from "@vercel/sdk/funcs/edgeConfigDeleteEdgeConfig.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await edgeConfigDeleteEdgeConfig(vercel, {
    edgeConfigId: "<id>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  
}

run();

Parameters

Parameter Type Required Description
request models.DeleteEdgeConfigRequest ✔️ 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.

Response

Promise<void>

Errors

Error Type Status Code Content Type
models.VercelBadRequestError 400 application/json
models.VercelForbiddenError 401 application/json
models.VercelNotFoundError 404 application/json
models.SDKError 4XX, 5XX */*

getEdgeConfigItems

Returns all items of an Edge Config.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.edgeConfig.getEdgeConfigItems({
    edgeConfigId: "<id>",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { edgeConfigGetEdgeConfigItems } from "@vercel/sdk/funcs/edgeConfigGetEdgeConfigItems.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await edgeConfigGetEdgeConfigItems(vercel, {
    edgeConfigId: "<id>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request models.GetEdgeConfigItemsRequest ✔️ 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.

Response

Promise<models.EdgeConfigItem>

Errors

Error Type Status Code Content Type
models.VercelBadRequestError 400 application/json
models.VercelForbiddenError 401 application/json
models.VercelNotFoundError 404 application/json
models.SDKError 4XX, 5XX */*

getEdgeConfigSchema

Returns the schema of an Edge Config.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.edgeConfig.getEdgeConfigSchema({
    edgeConfigId: "<id>",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { edgeConfigGetEdgeConfigSchema } from "@vercel/sdk/funcs/edgeConfigGetEdgeConfigSchema.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await edgeConfigGetEdgeConfigSchema(vercel, {
    edgeConfigId: "<id>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request models.GetEdgeConfigSchemaRequest ✔️ 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.

Response

Promise<models.GetEdgeConfigSchemaResponseBody>

Errors

Error Type Status Code Content Type
models.VercelBadRequestError 400 application/json
models.VercelForbiddenError 401 application/json
models.VercelNotFoundError 404 application/json
models.SDKError 4XX, 5XX */*

patchEdgeConfigSchema

Update an Edge Config's schema.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.edgeConfig.patchEdgeConfigSchema({
    edgeConfigId: "<id>",
    requestBody: {
      definition: "<value>",
    },
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { edgeConfigPatchEdgeConfigSchema } from "@vercel/sdk/funcs/edgeConfigPatchEdgeConfigSchema.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await edgeConfigPatchEdgeConfigSchema(vercel, {
    edgeConfigId: "<id>",
    requestBody: {
      definition: "<value>",
    },
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request models.PatchEdgeConfigSchemaRequest ✔️ 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.

Response

Promise<models.PatchEdgeConfigSchemaResponseBody>

Errors

Error Type Status Code Content Type
models.VercelBadRequestError 400 application/json
models.VercelForbiddenError 401 application/json
models.VercelNotFoundError 404 application/json
models.SDKError 4XX, 5XX */*

deleteEdgeConfigSchema

Deletes the schema of existing Edge Config.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  await vercel.edgeConfig.deleteEdgeConfigSchema({
    edgeConfigId: "<id>",
  });


}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { edgeConfigDeleteEdgeConfigSchema } from "@vercel/sdk/funcs/edgeConfigDeleteEdgeConfigSchema.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await edgeConfigDeleteEdgeConfigSchema(vercel, {
    edgeConfigId: "<id>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  
}

run();

Parameters

Parameter Type Required Description
request models.DeleteEdgeConfigSchemaRequest ✔️ 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.

Response

Promise<void>

Errors

Error Type Status Code Content Type
models.VercelBadRequestError 400 application/json
models.VercelForbiddenError 401 application/json
models.VercelNotFoundError 404 application/json
models.SDKError 4XX, 5XX */*

getEdgeConfigItem

Returns a specific Edge Config Item.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.edgeConfig.getEdgeConfigItem({
    edgeConfigId: "<id>",
    edgeConfigItemKey: "<value>",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { edgeConfigGetEdgeConfigItem } from "@vercel/sdk/funcs/edgeConfigGetEdgeConfigItem.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await edgeConfigGetEdgeConfigItem(vercel, {
    edgeConfigId: "<id>",
    edgeConfigItemKey: "<value>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request models.GetEdgeConfigItemRequest ✔️ 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.

Response

Promise<models.EdgeConfigItem>

Errors

Error Type Status Code Content Type
models.VercelBadRequestError 400 application/json
models.VercelForbiddenError 401 application/json
models.VercelNotFoundError 404 application/json
models.SDKError 4XX, 5XX */*

getEdgeConfigTokens

Returns all tokens of an Edge Config.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.edgeConfig.getEdgeConfigTokens({
    edgeConfigId: "<id>",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { edgeConfigGetEdgeConfigTokens } from "@vercel/sdk/funcs/edgeConfigGetEdgeConfigTokens.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await edgeConfigGetEdgeConfigTokens(vercel, {
    edgeConfigId: "<id>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request models.GetEdgeConfigTokensRequest ✔️ 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.

Response

Promise<models.EdgeConfigToken>

Errors

Error Type Status Code Content Type
models.VercelBadRequestError 400 application/json
models.VercelForbiddenError 401 application/json
models.VercelNotFoundError 404 application/json
models.SDKError 4XX, 5XX */*

deleteEdgeConfigTokens

Deletes one or more tokens of an existing Edge Config.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  await vercel.edgeConfig.deleteEdgeConfigTokens({
    edgeConfigId: "<id>",
    requestBody: {
      tokens: [
        "<value>",
      ],
    },
  });


}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { edgeConfigDeleteEdgeConfigTokens } from "@vercel/sdk/funcs/edgeConfigDeleteEdgeConfigTokens.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await edgeConfigDeleteEdgeConfigTokens(vercel, {
    edgeConfigId: "<id>",
    requestBody: {
      tokens: [
        "<value>",
      ],
    },
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  
}

run();

Parameters

Parameter Type Required Description
request models.DeleteEdgeConfigTokensRequest ✔️ 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.

Response

Promise<void>

Errors

Error Type Status Code Content Type
models.VercelBadRequestError 400 application/json
models.VercelForbiddenError 401 application/json
models.VercelNotFoundError 404 application/json
models.SDKError 4XX, 5XX */*

getEdgeConfigToken

Return meta data about an Edge Config token.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.edgeConfig.getEdgeConfigToken({
    edgeConfigId: "<id>",
    token: "<value>",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { edgeConfigGetEdgeConfigToken } from "@vercel/sdk/funcs/edgeConfigGetEdgeConfigToken.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await edgeConfigGetEdgeConfigToken(vercel, {
    edgeConfigId: "<id>",
    token: "<value>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request models.GetEdgeConfigTokenRequest ✔️ 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.

Response

Promise<models.EdgeConfigToken>

Errors

Error Type Status Code Content Type
models.VercelBadRequestError 400 application/json
models.VercelForbiddenError 401 application/json
models.VercelNotFoundError 404 application/json
models.SDKError 4XX, 5XX */*

createEdgeConfigToken

Adds a token to an existing Edge Config.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.edgeConfig.createEdgeConfigToken({
    edgeConfigId: "<id>",
    requestBody: {
      label: "<value>",
    },
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { edgeConfigCreateEdgeConfigToken } from "@vercel/sdk/funcs/edgeConfigCreateEdgeConfigToken.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await edgeConfigCreateEdgeConfigToken(vercel, {
    edgeConfigId: "<id>",
    requestBody: {
      label: "<value>",
    },
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request models.CreateEdgeConfigTokenRequest ✔️ 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.

Response

Promise<models.CreateEdgeConfigTokenResponseBody>

Errors

Error Type Status Code Content Type
models.VercelBadRequestError 400 application/json
models.VercelForbiddenError 401 application/json
models.VercelNotFoundError 404 application/json
models.SDKError 4XX, 5XX */*

getEdgeConfigBackup

Retrieves a specific version of an Edge Config from backup storage.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.edgeConfig.getEdgeConfigBackup({
    edgeConfigId: "<id>",
    edgeConfigBackupVersionId: "<id>",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { edgeConfigGetEdgeConfigBackup } from "@vercel/sdk/funcs/edgeConfigGetEdgeConfigBackup.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await edgeConfigGetEdgeConfigBackup(vercel, {
    edgeConfigId: "<id>",
    edgeConfigBackupVersionId: "<id>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request models.GetEdgeConfigBackupRequest ✔️ 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.

Response

Promise<models.GetEdgeConfigBackupResponseBody>

Errors

Error Type Status Code Content Type
models.VercelBadRequestError 400 application/json
models.VercelForbiddenError 401 application/json
models.VercelNotFoundError 404 application/json
models.SDKError 4XX, 5XX */*

getEdgeConfigBackups

Returns backups of an Edge Config.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.edgeConfig.getEdgeConfigBackups({
    edgeConfigId: "<id>",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { edgeConfigGetEdgeConfigBackups } from "@vercel/sdk/funcs/edgeConfigGetEdgeConfigBackups.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await edgeConfigGetEdgeConfigBackups(vercel, {
    edgeConfigId: "<id>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request models.GetEdgeConfigBackupsRequest ✔️ 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.

Response

Promise<models.GetEdgeConfigBackupsResponseBody>

Errors

Error Type Status Code Content Type
models.VercelBadRequestError 400 application/json
models.VercelForbiddenError 401 application/json
models.VercelNotFoundError 404 application/json
models.SDKError 4XX, 5XX */*