(projects)
- getProjects - Get a list of projects
- createProject - Create a new project
- updateProject - Update an existing project
- deleteProject - Delete a project
Get a list of projects
import { HoneyHive } from "honeyhive";
const honeyHive = new HoneyHive({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await honeyHive.projects.getProjects();
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { HoneyHiveCore } from "honeyhive/core.js";
import { projectsGetProjects } from "honeyhive/funcs/projectsGetProjects.js";
// Use `HoneyHiveCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const honeyHive = new HoneyHiveCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsGetProjects(honeyHive);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
name |
string | ➖ | 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<components.Project[]>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
Create a new project
import { HoneyHive } from "honeyhive";
const honeyHive = new HoneyHive({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await honeyHive.projects.createProject({
name: "<value>",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { HoneyHiveCore } from "honeyhive/core.js";
import { projectsCreateProject } from "honeyhive/funcs/projectsCreateProject.js";
// Use `HoneyHiveCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const honeyHive = new HoneyHiveCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsCreateProject(honeyHive, {
name: "<value>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
components.CreateProjectRequest | ✔️ | 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<components.Project>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
Update an existing project
import { HoneyHive } from "honeyhive";
const honeyHive = new HoneyHive({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
await honeyHive.projects.updateProject({
projectId: "<id>",
});
}
run();
The standalone function version of this method:
import { HoneyHiveCore } from "honeyhive/core.js";
import { projectsUpdateProject } from "honeyhive/funcs/projectsUpdateProject.js";
// Use `HoneyHiveCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const honeyHive = new HoneyHiveCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsUpdateProject(honeyHive, {
projectId: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
components.UpdateProjectRequest | ✔️ | 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<void>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
Delete a project
import { HoneyHive } from "honeyhive";
const honeyHive = new HoneyHive({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
await honeyHive.projects.deleteProject("<value>");
}
run();
The standalone function version of this method:
import { HoneyHiveCore } from "honeyhive/core.js";
import { projectsDeleteProject } from "honeyhive/funcs/projectsDeleteProject.js";
// Use `HoneyHiveCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const honeyHive = new HoneyHiveCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsDeleteProject(honeyHive, "<value>");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
name |
string | ✔️ | 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<void>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |