(config)
- subscribeToWebhooks - Subscribe to webhooks.
Subscribe to webhooks.
import { BarSDK } from "@speakeasy-sdks/speakeasy-bar";
const barSDK = new BarSDK({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
});
async function run() {
const result = await barSDK.config.subscribeToWebhooks([
{},
]);
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { BarSDKCore } from "@speakeasy-sdks/speakeasy-bar/core.js";
import { configSubscribeToWebhooks } from "@speakeasy-sdks/speakeasy-bar/funcs/configSubscribeToWebhooks.js";
// Use `BarSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const barSDK = new BarSDKCore({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
});
async function run() {
const res = await configSubscribeToWebhooks(barSDK, [
{},
]);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.RequestBody[] | ✔️ | 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.SubscribeToWebhooksResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.APIError | 5XX | application/json |
errors.SDKError | 4XX | */* |