Represents the information to create a publish token.

interface CreatePublishToken {
    allowedCountries?: string[];
    allowedIpAddresses?: string[];
    allowedOrigins?: string[];
    bindIpsOnUsage?: number;
    clip?: boolean;
    deniedCountries?: string[];
    displaySrtPassphrase?: boolean;
    enableThumbnails?: boolean;
    expires?: number;
    geoCascade?: PublishTokenGeoCascade;
    label: string;
    lowLatencyRtmp?: boolean;
    multisource?: boolean;
    originCluster?: string;
    record?: boolean;
    restream?: {
        key: string;
        url: string;
    }[];
    streams: PublishTokenStream[];
    subscribeRequiresAuth?: boolean;
}

Properties

allowedCountries?: string[]

Specify the ISO 3166-1 two letter country codes to explicitly allow viewer to watch the stream from. If the viewer's location does not match any of the specified countries, they will be blocked from viewing stream, else they will be allowed to view stream. This geo-fencing rule works in concert with the IP and domain restrictions as well. Specifying geo restriction rules in a token will override account-wide rules. Only one of allowedCountries or deniedCountries should be specified. If the specified streams require authentication, the list of allowed countries can be overridden by the subscribe token.

allowedIpAddresses?: string[]

May specify multiple IPv4 addresses or CIDR notated network blocks. If specified, the token will only be usable from those IP addresses.

Note

Not currently supported with RTMP.

allowedOrigins?: string[]

If specified only the domains in list will be allowed in requests to Director API with token. Wildcard subdomains are also allowed, e.g.: "*.demo.com". When unspecified (empty list) there are no domain restrictions.

bindIpsOnUsage?: number

If specified will bind the token to the first X IP addresses used with token in requests to Director API, thus restricting the token to those IP addresses without being known beforehand. Mutually exclusive with allowedIpAddresses option.

Note

Not currently supported with RTMP.

clip?: boolean

Set to true to allow this publish token to enable live clipping on specified streams. This flag cannot be set to true when the record flag is enabled.

Default Value

false.

Remarks

Live clipping is currently in Beta phase.

deniedCountries?: string[]

Specify the ISO 3166-1 two letter country codes to explicitly deny viewer to watch the stream from. If the viewer's location does match any of the specified countries, they will be blocked from viewing stream, else they will be allowed to view stream. This geo-fencing rule works in concert with the IP and domain restrictions as well. Specifying geo restriction rules in a token will override account-wide rules. Only one of allowedCountries or deniedCountries should be specified. If the specified streams require authentication, the list of denied countries can be overridden by the subscribe token.

displaySrtPassphrase?: boolean

Set to true to display passphrase encryption settings in the dashboard as well as returning the SRT passphrase in response to this API call.

Default Value

false.

enableThumbnails?: boolean

Set to true to receive webhook notifications for thumbnails for the specified streams.

expires?: number

Number of seconds until the token expires.

Default Value

If not specified, the token never expires.

Geo cascade settings for cascading stream to other clusters.

Default Value

Defaults to account related setting if unset.
label: string

Name for the token that is used to display in the dashboard.

lowLatencyRtmp?: boolean

Set to false disable the low latency mode for RTMP ingest.

Default Value

true.

multisource?: boolean

Set to false to disable the multi source capability for this publish token.

Default Value

true.

originCluster?: string

Cluster to route specified streams to.

Default Value

Default is the account's default cluster.
record?: boolean

Set to true to allow this publish token to be allowed to record the specified streams.

Default Value

false.

restream?: {
    key: string;
    url: string;
}[]

List of endpoints to restream the stream.

Type declaration

  • key: string

    Secret key for restreaming endpoint.

  • url: string

    The endpoint to restream media

Remarks

Restream is currently in Beta phase.

List of stream names.

subscribeRequiresAuth?: boolean

Set to true to require authentication to subscribe to the specified streams.

Default Value

false.