Reference Source Test
public class | source

SigningKeys

Extends:

events~EventEmittersrc/base.js~Base → SigningKeys

Signing Key Class - Provides access to the Mux Video Signing Key API

Example:

const { Video } = new Mux(accessToken, secret);

// Create a new signing key
Video.SigningKeys.create();

Test:

Method Summary

Public Methods
public

Creates a new Signing Key that can be used with the JWT module to sign URLs.

public

del(keyId: string): Promise

Delete a signing key

public

get(keyId: string): Promise

Get a signing key.

public

list(keyId: string, params: object): Promise

List signing keys

Public Methods

public create(): Promise source

Creates a new Signing Key that can be used with the JWT module to sign URLs.

Return:

Promise

Returns a resolved Promise with a response from the Mux API

Example:

const muxClient = new Mux(accessToken, secret);
const { Video } = muxClient;

// Create a new signing key
Video.SigningKeys.create();

See:

public del(keyId: string): Promise source

Delete a signing key

Params:

NameTypeAttributeDescription
keyId string

The ID for the signing key

Return:

Promise

Returns a resolved Promise with a response from the Mux API

Example:

const { Video } = new Mux(accessToken, secret);

// Delete a signing key
Video.SigningKeys.del(keyId);

Test:

See:

public get(keyId: string): Promise source

Get a signing key. Note The private key is not returned.

Params:

NameTypeAttributeDescription
keyId string

The ID for the signing key

Return:

Promise

Returns a resolved Promise with a response from the Mux API

Example:

const { Video } = new Mux(accessToken, secret);

// Get a signing key
Video.SigningKeys.get(keyId);

Test:

See:

public list(keyId: string, params: object): Promise source

List signing keys

Params:

NameTypeAttributeDescription
keyId string

The ID for the signing key

params object

Object to include as query params

params.limit number

Number of signing keys to return in the response

params.page number

Page of signing keys to return (limit * page)

Return:

Promise

Returns a resolved Promise with a response from the Mux API

Example:

const { Video } = new Mux(accessToken, secret);

// List all signing keys
Video.SigningKeys.list();

Test:

See: