Tracking.Runs
Overview
Available Operations
- create - Create
- get - Get
- search - Search
- update - Update
- delete - Delete
- restore - Restore
- logMetric - LogMetric
- logParameter - LogParameter
- setTag - SetTag
- deleteTag - DeleteTag
- logBatch - LogBatch
- logInputs - LogInputs
- getMetricHistory - GetMetricHistory
create
Requires write:tracking. Results are restricted to the API key organization and team.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.tracking.runs.create({
requestBody: {
experimentId: "<id>",
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { trackingRunsCreate } from "@meetkai/mka1/funcs/trackingRunsCreate.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await trackingRunsCreate(sdk, {
requestBody: {
experimentId: "<id>",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("trackingRunsCreate failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useTrackingRunsCreateMutation
} from "@meetkai/mka1/react-query/trackingRunsCreate.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.TrackingRunsCreateRequest | ✔️ | 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<operations.TrackingRunsCreateResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
get
Requires read:tracking. Results are restricted to the API key organization and team.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.tracking.runs.get({
runId: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { trackingRunsGet } from "@meetkai/mka1/funcs/trackingRunsGet.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await trackingRunsGet(sdk, {
runId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("trackingRunsGet failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useTrackingRunsGet,
useTrackingRunsGetSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchTrackingRunsGet,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateTrackingRunsGet,
invalidateAllTrackingRunsGet,
} from "@meetkai/mka1/react-query/trackingRunsGet.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.TrackingRunsGetRequest | ✔️ | 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<operations.TrackingRunsGetResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
search
Explicit experiment IDs are required; every experiment must belong to the caller. Requires read:tracking. Results are restricted to the API key organization and team.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.tracking.runs.search({
requestBody: {
experimentIds: [
"<value 1>",
],
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { trackingRunsSearch } from "@meetkai/mka1/funcs/trackingRunsSearch.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await trackingRunsSearch(sdk, {
requestBody: {
experimentIds: [
"<value 1>",
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("trackingRunsSearch failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useTrackingRunsSearchMutation
} from "@meetkai/mka1/react-query/trackingRunsSearch.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.TrackingRunsSearchRequest | ✔️ | 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<operations.TrackingRunsSearchResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
update
Requires write:tracking. Results are restricted to the API key organization and team.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.tracking.runs.update({
requestBody: {
runId: "<id>",
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { trackingRunsUpdate } from "@meetkai/mka1/funcs/trackingRunsUpdate.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await trackingRunsUpdate(sdk, {
requestBody: {
runId: "<id>",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("trackingRunsUpdate failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useTrackingRunsUpdateMutation
} from "@meetkai/mka1/react-query/trackingRunsUpdate.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.TrackingRunsUpdateRequest | ✔️ | 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<operations.TrackingRunsUpdateResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
delete
Requires write:tracking. Results are restricted to the API key organization and team.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.tracking.runs.delete({
requestBody: {
runId: "<id>",
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { trackingRunsDelete } from "@meetkai/mka1/funcs/trackingRunsDelete.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await trackingRunsDelete(sdk, {
requestBody: {
runId: "<id>",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("trackingRunsDelete failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useTrackingRunsDeleteMutation
} from "@meetkai/mka1/react-query/trackingRunsDelete.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.TrackingRunsDeleteRequest | ✔️ | 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<operations.TrackingRunsDeleteResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
restore
Requires write:tracking. Results are restricted to the API key organization and team.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.tracking.runs.restore({
requestBody: {
runId: "<id>",
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { trackingRunsRestore } from "@meetkai/mka1/funcs/trackingRunsRestore.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await trackingRunsRestore(sdk, {
requestBody: {
runId: "<id>",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("trackingRunsRestore failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useTrackingRunsRestoreMutation
} from "@meetkai/mka1/react-query/trackingRunsRestore.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.TrackingRunsRestoreRequest | ✔️ | 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<operations.TrackingRunsRestoreResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
logMetric
Requires write:tracking. Results are restricted to the API key organization and team.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.tracking.runs.logMetric({
requestBody: {
runId: "<id>",
key: "<key>",
value: 1403.55,
timestamp: 778356,
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { trackingRunsLogMetric } from "@meetkai/mka1/funcs/trackingRunsLogMetric.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await trackingRunsLogMetric(sdk, {
requestBody: {
runId: "<id>",
key: "<key>",
value: 1403.55,
timestamp: 778356,
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("trackingRunsLogMetric failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useTrackingRunsLogMetricMutation
} from "@meetkai/mka1/react-query/trackingRunsLogMetric.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.TrackingRunsLogMetricRequest | ✔️ | 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<operations.TrackingRunsLogMetricResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
logParameter
Requires write:tracking. Results are restricted to the API key organization and team.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.tracking.runs.logParameter({
requestBody: {
runId: "<id>",
key: "<key>",
value: "<value>",
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { trackingRunsLogParameter } from "@meetkai/mka1/funcs/trackingRunsLogParameter.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await trackingRunsLogParameter(sdk, {
requestBody: {
runId: "<id>",
key: "<key>",
value: "<value>",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("trackingRunsLogParameter failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useTrackingRunsLogParameterMutation
} from "@meetkai/mka1/react-query/trackingRunsLogParameter.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.TrackingRunsLogParameterRequest | ✔️ | 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<operations.TrackingRunsLogParameterResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
setTag
Requires write:tracking. Results are restricted to the API key organization and team.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.tracking.runs.setTag({
requestBody: {
runId: "<id>",
key: "<key>",
value: "<value>",
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { trackingRunsSetTag } from "@meetkai/mka1/funcs/trackingRunsSetTag.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await trackingRunsSetTag(sdk, {
requestBody: {
runId: "<id>",
key: "<key>",
value: "<value>",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("trackingRunsSetTag failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useTrackingRunsSetTagMutation
} from "@meetkai/mka1/react-query/trackingRunsSetTag.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.TrackingRunsSetTagRequest | ✔️ | 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<operations.TrackingRunsSetTagResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
deleteTag
Requires write:tracking. Results are restricted to the API key organization and team.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.tracking.runs.deleteTag({
requestBody: {
runId: "<id>",
key: "<key>",
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { trackingRunsDeleteTag } from "@meetkai/mka1/funcs/trackingRunsDeleteTag.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await trackingRunsDeleteTag(sdk, {
requestBody: {
runId: "<id>",
key: "<key>",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("trackingRunsDeleteTag failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useTrackingRunsDeleteTagMutation
} from "@meetkai/mka1/react-query/trackingRunsDeleteTag.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.TrackingRunsDeleteTagRequest | ✔️ | 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<operations.TrackingRunsDeleteTagResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
logBatch
Requires write:tracking. Results are restricted to the API key organization and team.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.tracking.runs.logBatch({
requestBody: {
runId: "<id>",
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { trackingRunsLogBatch } from "@meetkai/mka1/funcs/trackingRunsLogBatch.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await trackingRunsLogBatch(sdk, {
requestBody: {
runId: "<id>",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("trackingRunsLogBatch failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useTrackingRunsLogBatchMutation
} from "@meetkai/mka1/react-query/trackingRunsLogBatch.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.TrackingRunsLogBatchRequest | ✔️ | 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<operations.TrackingRunsLogBatchResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
logInputs
Requires write:tracking. Results are restricted to the API key organization and team.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.tracking.runs.logInputs({
requestBody: {
runId: "<id>",
datasets: [
{
dataset: {
name: "<value>",
digest: "<value>",
sourceType: "<value>",
source: "<value>",
},
},
],
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { trackingRunsLogInputs } from "@meetkai/mka1/funcs/trackingRunsLogInputs.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await trackingRunsLogInputs(sdk, {
requestBody: {
runId: "<id>",
datasets: [
{
dataset: {
name: "<value>",
digest: "<value>",
sourceType: "<value>",
source: "<value>",
},
},
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("trackingRunsLogInputs failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useTrackingRunsLogInputsMutation
} from "@meetkai/mka1/react-query/trackingRunsLogInputs.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.TrackingRunsLogInputsRequest | ✔️ | 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<operations.TrackingRunsLogInputsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
getMetricHistory
Requires read:tracking. Results are restricted to the API key organization and team.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.tracking.runs.getMetricHistory({
runId: "<id>",
metricKey: "<value>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { trackingRunsGetMetricHistory } from "@meetkai/mka1/funcs/trackingRunsGetMetricHistory.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await trackingRunsGetMetricHistory(sdk, {
runId: "<id>",
metricKey: "<value>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("trackingRunsGetMetricHistory failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useTrackingRunsGetMetricHistory,
useTrackingRunsGetMetricHistorySuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchTrackingRunsGetMetricHistory,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateTrackingRunsGetMetricHistory,
invalidateAllTrackingRunsGetMetricHistory,
} from "@meetkai/mka1/react-query/trackingRunsGetMetricHistory.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.TrackingRunsGetMetricHistoryRequest | ✔️ | 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<operations.TrackingRunsGetMetricHistoryResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |