(accessControl)
Operations related to access control/signing keys api
- create - Create a signing key
- getAll - Retrieves signing keys
- delete - Delete Signing Key
- get - Retrieves a signing key
- update - Update a signing key
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.
import { Livepeer } from "livepeer";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.accessControl.create();
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
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: "<YOUR_BEARER_TOKEN_HERE>",
});
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();
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<operations.CreateSigningKeyResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Retrieves signing keys
import { Livepeer } from "livepeer";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.accessControl.getAll();
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
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: "<YOUR_BEARER_TOKEN_HERE>",
});
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();
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<operations.GetSigningKeysResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Delete Signing Key
import { Livepeer } from "livepeer";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.accessControl.delete("<value>");
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
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: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await accessControlDelete(livepeer, "<value>");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
keyId |
string | ✔️ | ID of the signing key |
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.DeleteSigningKeyResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Retrieves a signing key
import { Livepeer } from "livepeer";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.accessControl.get("<value>");
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
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: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await accessControlGet(livepeer, "<value>");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
keyId |
string | ✔️ | ID of the signing key |
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.GetSigningKeyResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Update a signing key
import { Livepeer } from "livepeer";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.accessControl.update("<value>", {});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
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: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await accessControlUpdate(livepeer, "<value>", {});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
keyId |
string | ✔️ | ID of the signing key |
requestBody |
operations.UpdateSigningKeyRequestBody | ✔️ | 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<operations.UpdateSigningKeyResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |