# AccessControl (*accessControl*) ## Overview Operations related to access control/signing keys api ### Available Operations * [create](#create) - Create a signing key * [getAll](#getall) - Retrieves signing keys * [delete](#delete) - Delete Signing Key * [get](#get) - Retrieves a signing key * [update](#update) - Update a signing key ## create The publicKey is a representation of the public key, encoded as base 64 and is passed as a string, and the privateKey is displayed only on creation. This is the only moment where the client can save the private key, otherwise it will be lost. Remember to decode your string when signing JWTs. Up to 10 signing keys can be generated, after that you must delete at least one signing key to create a new one. ### Example Usage ```typescript import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.accessControl.create(); // Handle the result console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LivepeerCore } from "livepeer/core.js"; import { accessControlCreate } from "livepeer/funcs/accessControlCreate.js"; // Use `LivepeerCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const livepeer = new LivepeerCore({ apiKey: "", }); async function run() { const res = await accessControlCreate(livepeer); if (!res.ok) { throw res.error; } const { value: result } = res; // Handle the result console.log(result); } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.CreateSigningKeyResponse](../../models/operations/createsigningkeyresponse.md)\>** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | ## getAll Retrieves signing keys ### Example Usage ```typescript import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.accessControl.getAll(); // Handle the result console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LivepeerCore } from "livepeer/core.js"; import { accessControlGetAll } from "livepeer/funcs/accessControlGetAll.js"; // Use `LivepeerCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const livepeer = new LivepeerCore({ apiKey: "", }); async function run() { const res = await accessControlGetAll(livepeer); if (!res.ok) { throw res.error; } const { value: result } = res; // Handle the result console.log(result); } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.GetSigningKeysResponse](../../models/operations/getsigningkeysresponse.md)\>** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | ## delete Delete Signing Key ### Example Usage ```typescript import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.accessControl.delete(""); // Handle the result console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LivepeerCore } from "livepeer/core.js"; import { accessControlDelete } from "livepeer/funcs/accessControlDelete.js"; // Use `LivepeerCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const livepeer = new LivepeerCore({ apiKey: "", }); async function run() { const res = await accessControlDelete(livepeer, ""); if (!res.ok) { throw res.error; } const { value: result } = res; // Handle the result console.log(result); } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `keyId` | *string* | :heavy_check_mark: | ID of the signing key | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.DeleteSigningKeyResponse](../../models/operations/deletesigningkeyresponse.md)\>** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | ## get Retrieves a signing key ### Example Usage ```typescript import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.accessControl.get(""); // Handle the result console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LivepeerCore } from "livepeer/core.js"; import { accessControlGet } from "livepeer/funcs/accessControlGet.js"; // Use `LivepeerCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const livepeer = new LivepeerCore({ apiKey: "", }); async function run() { const res = await accessControlGet(livepeer, ""); if (!res.ok) { throw res.error; } const { value: result } = res; // Handle the result console.log(result); } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `keyId` | *string* | :heavy_check_mark: | ID of the signing key | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.GetSigningKeyResponse](../../models/operations/getsigningkeyresponse.md)\>** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | ## update Update a signing key ### Example Usage ```typescript import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.accessControl.update({}, ""); // Handle the result console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LivepeerCore } from "livepeer/core.js"; import { accessControlUpdate } from "livepeer/funcs/accessControlUpdate.js"; // Use `LivepeerCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const livepeer = new LivepeerCore({ apiKey: "", }); async function run() { const res = await accessControlUpdate(livepeer, {}, ""); if (!res.ok) { throw res.error; } const { value: result } = res; // Handle the result console.log(result); } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `keyId` | *string* | :heavy_check_mark: | ID of the signing key | | `requestBody` | [operations.UpdateSigningKeyRequestBody](../../models/operations/updatesigningkeyrequestbody.md) | :heavy_check_mark: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.UpdateSigningKeyResponse](../../models/operations/updatesigningkeyresponse.md)\>** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* |