Documentation
Library Exports.Subscription
A YouTube subscription.
Constructors
constructor
• new Subscription(youtube
, data
, full?
)
Parameters
Name | Type | Default value |
---|---|---|
youtube | YouTube | undefined |
data | any | undefined |
full | boolean | true |
Defined in
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
channel
• channel: Object
Information on the Channel that the user subscribed to.
Type declaration
Name | Type | Description |
---|---|---|
id | string | The ID of the channel. |
name | string | The name of the channel. |
Defined in
data
• data: any
The raw data of this subscription.
Defined in
dateSubscribed
• dateSubscribed: Date
The date that the user subscribed to the channel on.
Defined in
description
• description: string
The details of the subscription.
Defined in
full
• full: boolean
= true
Whether or not this is a full subscription object.
Defined in
id
• id: string
The ID of this subscription.
Defined in
items
• items: Object
Statistics on the items that the subscription points to.
CURRENTLY NOT WORKING, see https://issuetracker.google.com/issues/181152600
Type declaration
Name | Type | Description |
---|---|---|
new | number | The number of new items in the subscription. |
total | number | The total number of items that the subscription points to. |
Defined in
subscriber
• subscriber: Object
Information on the user that subscribed to the channel.
CURRENTLY NOT WORKING, see https://issuetracker.google.com/issues/181152600
Type declaration
Name | Type | Description |
---|---|---|
description? | string | The user's description. |
id | string | The user's ID. |
name? | string | The user's username. |
thumbnails? | { default : Thumbnail ; high : Thumbnail ; medium : Thumbnail } | Thumbnail images for the user's channel. |
thumbnails.default | Thumbnail | - |
thumbnails.high | Thumbnail | - |
thumbnails.medium | Thumbnail | - |
Defined in
thumbnails
• thumbnails: Object
Thumbnail images for the subscription.
Type declaration
Name | Type |
---|---|
default | Thumbnail |
high | Thumbnail |
medium | Thumbnail |
Defined in
title
• title: string
The title of the subscription.
Defined in
youtube
• youtube: YouTube
The YouTube object that created this subscription object.
Defined in
endpoint
▪ Static
endpoint: string
= 'subscriptions'
The name of the endpoint used for this entity.
Defined in
fields
▪ Static
fields: string
The fields to request for this entity.
Defined in
part
▪ Static
part: string
= 'snippet,contentDetails,subscriberSnippet'
The parts to request for this entity.
Defined in
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
Name | Type |
---|---|
parts? | SubscriptionParts |
Returns
Promise
<Subscription
>
Defined in
getChannel
▸ getChannel(parts?
): Promise
<Channel
>
Parameters
Name | Type |
---|---|
parts? | ChannelParts |
Returns
Promise
<Channel
>
Defined in
getSubscriber
▸ getSubscriber(parts?
): Promise
<Channel
>
Parameters
Name | Type |
---|---|
parts? | ChannelParts |
Returns
Promise
<Channel
>