(themes)
Themes
- listThemes - List all themes
- createTheme - Create a theme
- updateTheme - Update theme metadata
- replaceThemeDocument - Update theme document
- deleteTheme - Delete a theme
- getTheme - Get a theme
List all team themes.
import { Scalar } from "@scalar/sdk";
const scalar = new Scalar({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await scalar.themes.listThemes();
console.log(result);
}
run();The standalone function version of this method:
import { ScalarCore } from "@scalar/sdk/core.js";
import { themesListThemes } from "@scalar/sdk/funcs/themesListThemes.js";
// Use `ScalarCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const scalar = new ScalarCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await themesListThemes(scalar);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("themesListThemes failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
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.ListThemesResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.FourHundred | 400 | application/json |
| errors.FourHundredAndOne | 401 | application/json |
| errors.FourHundredAndThree | 403 | application/json |
| errors.FourHundredAndFour | 404 | application/json |
| errors.FourHundredAndTwentyTwo | 422 | application/json |
| errors.FiveHundred | 500 | application/json |
| errors.APIError | 4XX, 5XX | */* |
Create a team theme.
import { Scalar } from "@scalar/sdk";
const scalar = new Scalar({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await scalar.themes.createTheme({
name: "<value>",
slug: "<value>",
document: "<value>",
});
console.log(result);
}
run();The standalone function version of this method:
import { ScalarCore } from "@scalar/sdk/core.js";
import { themesCreateTheme } from "@scalar/sdk/funcs/themesCreateTheme.js";
// Use `ScalarCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const scalar = new ScalarCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await themesCreateTheme(scalar, {
name: "<value>",
slug: "<value>",
document: "<value>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("themesCreateTheme failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.CreateThemeRequestBody | ✔️ | 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.CreateThemeResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.FourHundred | 400 | application/json |
| errors.FourHundredAndOne | 401 | application/json |
| errors.FourHundredAndThree | 403 | application/json |
| errors.FourHundredAndFour | 404 | application/json |
| errors.FourHundredAndTwentyTwo | 422 | application/json |
| errors.FiveHundred | 500 | application/json |
| errors.APIError | 4XX, 5XX | */* |
Update theme metadata.
import { Scalar } from "@scalar/sdk";
const scalar = new Scalar({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await scalar.themes.updateTheme({
slug: "<value>",
requestBody: {},
});
console.log(result);
}
run();The standalone function version of this method:
import { ScalarCore } from "@scalar/sdk/core.js";
import { themesUpdateTheme } from "@scalar/sdk/funcs/themesUpdateTheme.js";
// Use `ScalarCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const scalar = new ScalarCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await themesUpdateTheme(scalar, {
slug: "<value>",
requestBody: {},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("themesUpdateTheme failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.UpdateThemeRequest | ✔️ | 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.UpdateThemeResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.FourHundred | 400 | application/json |
| errors.FourHundredAndOne | 401 | application/json |
| errors.FourHundredAndThree | 403 | application/json |
| errors.FourHundredAndFour | 404 | application/json |
| errors.FourHundredAndTwentyTwo | 422 | application/json |
| errors.FiveHundred | 500 | application/json |
| errors.APIError | 4XX, 5XX | */* |
Replace the theme document.
import { Scalar } from "@scalar/sdk";
const scalar = new Scalar({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await scalar.themes.replaceThemeDocument({
slug: "<value>",
requestBody: {
document: "<value>",
},
});
console.log(result);
}
run();The standalone function version of this method:
import { ScalarCore } from "@scalar/sdk/core.js";
import { themesReplaceThemeDocument } from "@scalar/sdk/funcs/themesReplaceThemeDocument.js";
// Use `ScalarCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const scalar = new ScalarCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await themesReplaceThemeDocument(scalar, {
slug: "<value>",
requestBody: {
document: "<value>",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("themesReplaceThemeDocument failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.ReplaceThemeDocumentRequest | ✔️ | 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.ReplaceThemeDocumentResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.FourHundred | 400 | application/json |
| errors.FourHundredAndOne | 401 | application/json |
| errors.FourHundredAndThree | 403 | application/json |
| errors.FourHundredAndFour | 404 | application/json |
| errors.FourHundredAndTwentyTwo | 422 | application/json |
| errors.FiveHundred | 500 | application/json |
| errors.APIError | 4XX, 5XX | */* |
Delete a theme by slug.
import { Scalar } from "@scalar/sdk";
const scalar = new Scalar({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await scalar.themes.deleteTheme({
slug: "<value>",
});
console.log(result);
}
run();The standalone function version of this method:
import { ScalarCore } from "@scalar/sdk/core.js";
import { themesDeleteTheme } from "@scalar/sdk/funcs/themesDeleteTheme.js";
// Use `ScalarCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const scalar = new ScalarCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await themesDeleteTheme(scalar, {
slug: "<value>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("themesDeleteTheme failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.DeleteThemeRequest | ✔️ | 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.DeleteThemeResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.FourHundred | 400 | application/json |
| errors.FourHundredAndOne | 401 | application/json |
| errors.FourHundredAndThree | 403 | application/json |
| errors.FourHundredAndFour | 404 | application/json |
| errors.FourHundredAndTwentyTwo | 422 | application/json |
| errors.FiveHundred | 500 | application/json |
| errors.APIError | 4XX, 5XX | */* |
Get the theme document by slug.
import { Scalar } from "@scalar/sdk";
const scalar = new Scalar({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await scalar.themes.getTheme({
slug: "<value>",
});
console.log(result);
}
run();The standalone function version of this method:
import { ScalarCore } from "@scalar/sdk/core.js";
import { themesGetTheme } from "@scalar/sdk/funcs/themesGetTheme.js";
// Use `ScalarCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const scalar = new ScalarCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await themesGetTheme(scalar, {
slug: "<value>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("themesGetTheme failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetThemeRequest | ✔️ | 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.GetThemeResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.FourHundred | 400 | application/json |
| errors.FourHundredAndOne | 401 | application/json |
| errors.FourHundredAndThree | 403 | application/json |
| errors.FourHundredAndFour | 404 | application/json |
| errors.FourHundredAndTwentyTwo | 422 | application/json |
| errors.FiveHundred | 500 | application/json |
| errors.APIError | 4XX, 5XX | */* |