(publishingTokens)
- create - Create a publishing token for a workspace
- delete - Delete a specific publishing token
- get - Get a specific publishing token
- list - Get publishing tokens for a workspace
- resolveMetadata - Get metadata about the token
- resolveTarget - Get a specific publishing token target
- update - Updates the validitity period of a publishing token
Creates a publishing token for the current workspace
import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
const speakeasy = new Speakeasy({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
});
async function run() {
const result = await speakeasy.publishingTokens.create();
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js";
import { publishingTokensCreate } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/publishingTokensCreate.js";
// Use `SpeakeasyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const speakeasy = new SpeakeasyCore({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
});
async function run() {
const res = await publishingTokensCreate(speakeasy);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
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.
usePublishingTokensCreateMutation
} from "@speakeasy-api/speakeasy-client-sdk-typescript/react-query/publishingTokensCreate.js";
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.CreatePublishingTokenRequestBody | ✔️ | 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<shared.PublishingToken>
Error Type | Status Code | Content Type |
---|---|---|
errors.ErrorT | 4XX | application/json |
errors.SDKError | 5XX | */* |
Delete a particular publishing token.
import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
const speakeasy = new Speakeasy({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
});
async function run() {
await speakeasy.publishingTokens.delete({
tokenID: "<id>",
});
}
run();
The standalone function version of this method:
import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js";
import { publishingTokensDelete } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/publishingTokensDelete.js";
// Use `SpeakeasyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const speakeasy = new SpeakeasyCore({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
});
async function run() {
const res = await publishingTokensDelete(speakeasy, {
tokenID: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
}
run();
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.
usePublishingTokensDeleteMutation
} from "@speakeasy-api/speakeasy-client-sdk-typescript/react-query/publishingTokensDelete.js";
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.DeletePublishingTokenRequest | ✔️ | 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.ErrorT | 4XX | application/json |
errors.SDKError | 5XX | */* |
Get information about a particular publishing token.
import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
const speakeasy = new Speakeasy({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
});
async function run() {
const result = await speakeasy.publishingTokens.get({
tokenID: "<id>",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js";
import { publishingTokensGet } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/publishingTokensGet.js";
// Use `SpeakeasyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const speakeasy = new SpeakeasyCore({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
});
async function run() {
const res = await publishingTokensGet(speakeasy, {
tokenID: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
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.
usePublishingTokensGet,
usePublishingTokensGetSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchPublishingTokensGet,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidatePublishingTokensGet,
invalidateAllPublishingTokensGet,
} from "@speakeasy-api/speakeasy-client-sdk-typescript/react-query/publishingTokensGet.js";
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetPublishingTokenByIDRequest | ✔️ | 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<shared.PublishingToken>
Error Type | Status Code | Content Type |
---|---|---|
errors.ErrorT | 4XX | application/json |
errors.SDKError | 5XX | */* |
Returns a publishing token for the current workspace
import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
const speakeasy = new Speakeasy({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
});
async function run() {
const result = await speakeasy.publishingTokens.list();
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js";
import { publishingTokensList } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/publishingTokensList.js";
// Use `SpeakeasyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const speakeasy = new SpeakeasyCore({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
});
async function run() {
const res = await publishingTokensList(speakeasy);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
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.
usePublishingTokensList,
usePublishingTokensListSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchPublishingTokensList,
// Utility to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateAllPublishingTokensList,
} from "@speakeasy-api/speakeasy-client-sdk-typescript/react-query/publishingTokensList.js";
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<shared.PublishingToken[]>
Error Type | Status Code | Content Type |
---|---|---|
errors.ErrorT | 4XX | application/json |
errors.SDKError | 5XX | */* |
Get information about a particular publishing token.
import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
const speakeasy = new Speakeasy({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
});
async function run() {
const result = await speakeasy.publishingTokens.resolveMetadata({
tokenID: "<id>",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js";
import { publishingTokensResolveMetadata } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/publishingTokensResolveMetadata.js";
// Use `SpeakeasyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const speakeasy = new SpeakeasyCore({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
});
async function run() {
const res = await publishingTokensResolveMetadata(speakeasy, {
tokenID: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
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.
usePublishingTokensResolveMetadata,
usePublishingTokensResolveMetadataSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchPublishingTokensResolveMetadata,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidatePublishingTokensResolveMetadata,
invalidateAllPublishingTokensResolveMetadata,
} from "@speakeasy-api/speakeasy-client-sdk-typescript/react-query/publishingTokensResolveMetadata.js";
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetPublishingTokenPublicMetadataRequest | ✔️ | 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.GetPublishingTokenPublicMetadataResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
errors.ErrorT | 4XX | application/json |
errors.SDKError | 5XX | */* |
Get information about a particular publishing token target.
import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
const speakeasy = new Speakeasy({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
});
async function run() {
const result = await speakeasy.publishingTokens.resolveTarget({
tokenID: "<id>",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js";
import { publishingTokensResolveTarget } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/publishingTokensResolveTarget.js";
// Use `SpeakeasyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const speakeasy = new SpeakeasyCore({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
});
async function run() {
const res = await publishingTokensResolveTarget(speakeasy, {
tokenID: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
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.
usePublishingTokensResolveTarget,
usePublishingTokensResolveTargetSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchPublishingTokensResolveTarget,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidatePublishingTokensResolveTarget,
invalidateAllPublishingTokensResolveTarget,
} from "@speakeasy-api/speakeasy-client-sdk-typescript/react-query/publishingTokensResolveTarget.js";
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetPublishingTokenTargetByIDRequest | ✔️ | 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<string>
Error Type | Status Code | Content Type |
---|---|---|
errors.ErrorT | 4XX | application/json |
errors.SDKError | 5XX | */* |
Updates the validity period of a particular publishing token.
import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
const speakeasy = new Speakeasy({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
});
async function run() {
await speakeasy.publishingTokens.update({
tokenID: "<id>",
});
}
run();
The standalone function version of this method:
import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js";
import { publishingTokensUpdate } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/publishingTokensUpdate.js";
// Use `SpeakeasyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const speakeasy = new SpeakeasyCore({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
});
async function run() {
const res = await publishingTokensUpdate(speakeasy, {
tokenID: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
}
run();
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.
usePublishingTokensUpdateMutation
} from "@speakeasy-api/speakeasy-client-sdk-typescript/react-query/publishingTokensUpdate.js";
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.UpdatePublishingTokenExpirationRequest | ✔️ | 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.ErrorT | 4XX | application/json |
errors.SDKError | 5XX | */* |