Skip to main content

Documentation

Library Exports.Subscription

A YouTube subscription.

Constructors

constructor

new Subscription(youtube, data, full?)

Parameters

NameTypeDefault value
youtubeYouTubeundefined
dataanyundefined
fullbooleantrue

Defined in

entities/subscription.ts:138

Properties

activities

activities: "all" | "uploads"

The activities that the user has subscribed to.
CURRENTLY NOT WORKING, see https://issuetracker.google.com/issues/181152600

Defined in

entities/subscription.ts:136


channel

channel: Object

Information on the Channel that the user subscribed to.

Type declaration

NameTypeDescription
idstringThe ID of the channel.
namestringThe name of the channel.

Defined in

entities/subscription.ts:55


data

data: any

The raw data of this subscription.

Defined in

entities/subscription.ts:40


dateSubscribed

dateSubscribed: Date

The date that the user subscribed to the channel on.

Defined in

entities/subscription.ts:50


description

description: string

The details of the subscription.

Defined in

entities/subscription.ts:75


full

full: boolean = true

Whether or not this is a full subscription object.

Defined in

entities/subscription.ts:35


id

id: string

The ID of this subscription.

Defined in

entities/subscription.ts:45


items

items: Object

Statistics on the items that the subscription points to.
CURRENTLY NOT WORKING, see https://issuetracker.google.com/issues/181152600

Type declaration

NameTypeDescription
newnumberThe number of new items in the subscription.
totalnumberThe total number of items that the subscription points to.

Defined in

entities/subscription.ts:120


subscriber

subscriber: Object

Information on the user that subscribed to the channel.
CURRENTLY NOT WORKING, see https://issuetracker.google.com/issues/181152600

Type declaration

NameTypeDescription
description?stringThe user's description.
idstringThe user's ID.
name?stringThe user's username.
thumbnails?{ default: Thumbnail ; high: Thumbnail ; medium: Thumbnail }Thumbnail images for the user's channel.
thumbnails.defaultThumbnail-
thumbnails.highThumbnail-
thumbnails.mediumThumbnail-

Defined in

entities/subscription.ts:81


thumbnails

thumbnails: Object

Thumbnail images for the subscription.

Type declaration

NameType
defaultThumbnail
highThumbnail
mediumThumbnail

Defined in

entities/subscription.ts:110


title

title: string

The title of the subscription.

Defined in

entities/subscription.ts:70


youtube

youtube: YouTube

The YouTube object that created this subscription object.

Defined in

entities/subscription.ts:30


endpoint

Static endpoint: string = 'subscriptions'

The name of the endpoint used for this entity.

Defined in

entities/subscription.ts:12


fields

Static fields: string

The fields to request for this entity.

Defined in

entities/subscription.ts:22


part

Static part: string = 'snippet,contentDetails,subscriberSnippet'

The parts to request for this entity.

Defined in

entities/subscription.ts:17

Methods

fetch

fetch(parts?): Promise<Subscription>

Fetches this subscription from the API and reassigns this object to the new subscription object. Only useful if this.full is false, or if you want updated subscription info.
CURRENTLY NOT WORKING unless the subscriber and channel properties are populated, see https://issuetracker.google.com/issues/288609601

Parameters

NameType
parts?SubscriptionParts

Returns

Promise<Subscription>

Defined in

entities/subscription.ts:192


getChannel

getChannel(parts?): Promise<Channel>

Parameters

NameType
parts?ChannelParts

Returns

Promise<Channel>

Defined in

entities/subscription.ts:203


getSubscriber

getSubscriber(parts?): Promise<Channel>

Parameters

NameType
parts?ChannelParts

Returns

Promise<Channel>

Defined in

entities/subscription.ts:208