(domains)
Domains
- buy - Purchase a domain
- checkPrice - Check the price for a domain
- checkStatus - Check a Domain Availability
- getTransfer - Get domain transfer info.
- getConfig - Get a Domain's configuration
- get - Get Information for a Single Domain
- list - List all the domains
- createOrTransfer - Register or transfer-in a new Domain
- update - Update or move apex domain
- delete - Remove a domain by name
- listByProject - Retrieve project domains by project by id or name
- create - Add a domain to a project
- verify - Verify project domain
Allows to purchase the specified domain.
import { Vercel } from "@simplesagar/vercel";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.buy();
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { VercelCore } from "@simplesagar/vercel/core.js";
import { domainsBuy } from "@simplesagar/vercel/funcs/domainsBuy.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 domainsBuy(vercel);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
teamId |
string | ➖ | The Team identifier to perform the request on behalf of. |
slug |
string | ➖ | The Team slug to perform the request on behalf of. |
requestBody |
models.BuyDomainRequestBody | ➖ | N/A |
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<models.BuyDomainResponse>
Error Object | Status Code | Content Type |
---|---|---|
models.SDKError | 4xx-5xx | / |
Check the price to purchase a domain and how long a single purchase period is.
import { Vercel } from "@simplesagar/vercel";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.checkPrice("example.com");
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { VercelCore } from "@simplesagar/vercel/core.js";
import { domainsCheckPrice } from "@simplesagar/vercel/funcs/domainsCheckPrice.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 domainsCheckPrice(vercel, "example.com");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
name |
string | ✔️ | The name of the domain for which the price needs to be checked. | [object Object] |
type |
models.QueryParamType | ➖ | In which status of the domain the price needs to be checked. | [object Object] |
teamId |
string | ➖ | The Team identifier to perform the request on behalf of. | |
slug |
string | ➖ | The Team slug to perform the request on behalf of. | |
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<models.CheckDomainPriceResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
models.SDKError | 4xx-5xx | / |
Check if a domain name is available for purchase.
import { Vercel } from "@simplesagar/vercel";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.checkStatus("example.com");
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { VercelCore } from "@simplesagar/vercel/core.js";
import { domainsCheckStatus } from "@simplesagar/vercel/funcs/domainsCheckStatus.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 domainsCheckStatus(vercel, "example.com");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
name |
string | ✔️ | The name of the domain for which we would like to check the status. | [object Object] |
teamId |
string | ➖ | The Team identifier to perform the request on behalf of. | |
slug |
string | ➖ | The Team slug to perform the request on behalf of. | |
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<models.CheckDomainStatusResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
models.SDKError | 4xx-5xx | / |
Fetch domain transfer availability or transfer status if a transfer is in progress.
import { Vercel } from "@simplesagar/vercel";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.getTransfer("example.com");
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { VercelCore } from "@simplesagar/vercel/core.js";
import { domainsGetTransfer } from "@simplesagar/vercel/funcs/domainsGetTransfer.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 domainsGetTransfer(vercel, "example.com");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
domain |
string | ✔️ | N/A | [object Object] |
teamId |
string | ➖ | The Team identifier to perform the request on behalf of. | |
slug |
string | ➖ | The Team slug to perform the request on behalf of. | |
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<models.GetDomainTransferResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
models.SDKError | 4xx-5xx | / |
Get a Domain's configuration.
import { Vercel } from "@simplesagar/vercel";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.getConfig("example.com");
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { VercelCore } from "@simplesagar/vercel/core.js";
import { domainsGetConfig } from "@simplesagar/vercel/funcs/domainsGetConfig.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 domainsGetConfig(vercel, "example.com");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
domain |
string | ✔️ | The name of the domain. | [object Object] |
strict |
models.Strict | ➖ | When true, the response will only include the nameservers assigned directly to the specified domain. When false and there are no nameservers assigned directly to the specified domain, the response will include the nameservers of the domain's parent zone. | |
teamId |
string | ➖ | The Team identifier to perform the request on behalf of. | |
slug |
string | ➖ | The Team slug to perform the request on behalf of. | |
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<models.GetDomainConfigResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
models.SDKError | 4xx-5xx | / |
Get information for a single domain in an account or team.
import { Vercel } from "@simplesagar/vercel";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.get("example.com");
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { VercelCore } from "@simplesagar/vercel/core.js";
import { domainsGet } from "@simplesagar/vercel/funcs/domainsGet.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 domainsGet(vercel, "example.com");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
domain |
string | ✔️ | The name of the domain. | [object Object] |
teamId |
string | ➖ | The Team identifier to perform the request on behalf of. | |
slug |
string | ➖ | The Team slug to perform the request on behalf of. | |
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<models.GetDomainResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
models.SDKError | 4xx-5xx | / |
Retrieves a list of domains registered for the authenticated user or team. By default it returns the last 20 domains if no limit is provided.
import { Vercel } from "@simplesagar/vercel";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.list({});
for await (const page of result) {
// Handle the page
console.log(page);
}
}
run();
The standalone function version of this method:
import { VercelCore } from "@simplesagar/vercel/core.js";
import { domainsList } from "@simplesagar/vercel/funcs/domainsList.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 domainsList(vercel, {});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
for await (const page of result) {
// Handle the page
console.log(page);
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.GetDomainsRequest | ✔️ | 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<models.GetDomainsResponse>
Error Object | Status Code | Content Type |
---|---|---|
models.SDKError | 4xx-5xx | / |
This endpoint is used for adding a new apex domain name with Vercel for the authenticating user. Can also be used for initiating a domain transfer request from an external Registrar to Vercel.
import { Vercel } from "@simplesagar/vercel";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.createOrTransfer();
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { VercelCore } from "@simplesagar/vercel/core.js";
import { domainsCreateOrTransfer } from "@simplesagar/vercel/funcs/domainsCreateOrTransfer.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 domainsCreateOrTransfer(vercel);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
teamId |
string | ➖ | The Team identifier to perform the request on behalf of. |
slug |
string | ➖ | The Team slug to perform the request on behalf of. |
requestBody |
models.CreateOrTransferDomainRequestBody | ➖ | N/A |
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<models.CreateOrTransferDomainResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
models.SDKError | 4xx-5xx | / |
Update or move apex domain.
import { Vercel } from "@simplesagar/vercel";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.update("tidy-amazon.name");
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { VercelCore } from "@simplesagar/vercel/core.js";
import { domainsUpdate } from "@simplesagar/vercel/funcs/domainsUpdate.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 domainsUpdate(vercel, "tidy-amazon.name");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
domain |
string | ✔️ | N/A |
teamId |
string | ➖ | The Team identifier to perform the request on behalf of. |
slug |
string | ➖ | The Team slug to perform the request on behalf of. |
requestBody |
models.PatchDomainRequestBody | ➖ | N/A |
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<models.PatchDomainResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
models.SDKError | 4xx-5xx | / |
Delete a previously registered domain name from Vercel. Deleting a domain will automatically remove any associated aliases.
import { Vercel } from "@simplesagar/vercel";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.delete("example.com");
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { VercelCore } from "@simplesagar/vercel/core.js";
import { domainsDelete } from "@simplesagar/vercel/funcs/domainsDelete.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 domainsDelete(vercel, "example.com");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
domain |
string | ✔️ | The name of the domain. | [object Object] |
teamId |
string | ➖ | The Team identifier to perform the request on behalf of. | |
slug |
string | ➖ | The Team slug to perform the request on behalf of. | |
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<models.DeleteDomainResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
models.SDKError | 4xx-5xx | / |
Retrieve the domains associated with a given project by passing either the project id
or name
in the URL.
import { Vercel } from "@simplesagar/vercel";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.listByProject({
idOrName: "<value>",
});
for await (const page of result) {
// Handle the page
console.log(page);
}
}
run();
The standalone function version of this method:
import { VercelCore } from "@simplesagar/vercel/core.js";
import { domainsListByProject } from "@simplesagar/vercel/funcs/domainsListByProject.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 domainsListByProject(vercel, {
idOrName: "<value>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
for await (const page of result) {
// Handle the page
console.log(page);
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.GetProjectDomainsRequest | ✔️ | 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<models.GetProjectDomainsResponse>
Error Object | Status Code | Content Type |
---|---|---|
models.SDKError | 4xx-5xx | / |
Add a domain to the project by passing its domain name and by specifying the project by either passing the project id
or name
in the URL. If the domain is not yet verified to be used on this project, the request will return verified = false
, and the domain will need to be verified according to the verification
challenge via POST /projects/:idOrName/domains/:domain/verify
. If the domain already exists on the project, the request will fail with a 400
status code.
import { Vercel } from "@simplesagar/vercel";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.create("<value>");
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { VercelCore } from "@simplesagar/vercel/core.js";
import { domainsCreate } from "@simplesagar/vercel/funcs/domainsCreate.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 domainsCreate(vercel, "<value>");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
idOrName |
string | ✔️ | The unique project identifier or the project name |
teamId |
string | ➖ | The Team identifier to perform the request on behalf of. |
slug |
string | ➖ | The Team slug to perform the request on behalf of. |
requestBody |
models.AddProjectDomainRequestBody | ➖ | N/A |
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<models.AddProjectDomainResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
models.SDKError | 4xx-5xx | / |
Attempts to verify a project domain with verified = false
by checking the correctness of the project domain's verification
challenge.
import { Vercel } from "@simplesagar/vercel";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.verify("prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB", "example.com");
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { VercelCore } from "@simplesagar/vercel/core.js";
import { domainsVerify } from "@simplesagar/vercel/funcs/domainsVerify.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 domainsVerify(vercel, "prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB", "example.com");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
idOrName |
string | ✔️ | The unique project identifier or the project name | [object Object] |
domain |
string | ✔️ | The domain name you want to verify | [object Object] |
teamId |
string | ➖ | The Team identifier to perform the request on behalf of. | |
slug |
string | ➖ | The Team slug to perform the request on behalf of. | |
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<models.VerifyProjectDomainResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
models.SDKError | 4xx-5xx | / |