(certs)
- getCertById - Get cert by id
- removeCert - Remove cert
- issueCert - Issue a new cert
- uploadCert - Upload a cert
Get cert by id
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.certs.getCertById({
id: "<id>",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { certsGetCertById } from "@vercel/sdk/funcs/certsGetCertById.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 certsGetCertById(vercel, {
id: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.GetCertByIdRequest | ✔️ | 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.GetCertByIdResponseBody>
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 | */* |
Remove cert
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.certs.removeCert({
id: "<id>",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { certsRemoveCert } from "@vercel/sdk/funcs/certsRemoveCert.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 certsRemoveCert(vercel, {
id: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.RemoveCertRequest | ✔️ | 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.RemoveCertResponseBody>
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 | */* |
Issue a new cert
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.certs.issueCert({
requestBody: {},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { certsIssueCert } from "@vercel/sdk/funcs/certsIssueCert.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 certsIssueCert(vercel, {
requestBody: {},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.IssueCertRequest | ✔️ | 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.IssueCertResponseBody>
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 | */* |
Upload a cert
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.certs.uploadCert({
requestBody: {
ca: "<value>",
key: "<key>",
cert: "<value>",
},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { certsUploadCert } from "@vercel/sdk/funcs/certsUploadCert.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 certsUploadCert(vercel, {
requestBody: {
ca: "<value>",
key: "<key>",
cert: "<value>",
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.UploadCertRequest | ✔️ | 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.UploadCertResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.SDKError | 4XX, 5XX | */* |