The Singularity event used to notify apps when a channel gets a new subscriber
This Event is Part of an Event Chain
This event is called as soon as channel gains a new subscriber and is always followed by the subscriber-benefits-change event.
Using Socket.IO, this event can be listened to as follows:
socket.on('subscriber-new', function(data){
//Do something
});
This event fires whenever a channel gains a new subscriber and has the following JSON structure:
{
event: "subscriber-new",
channel_id: "channel identifier ",
channel: {
names: {
gamewisp: "GameWisp channel name",
twitch: "twitch channel name",
youtube: "youtube channel name"
},
ids: {
gamewisp: "channel identifier",
twitch: "12312312q",
youtube: "UCiqp4J8asdkssssssssdfae"
}
},
data: {
ids: {
gamewisp: "26356",
twitch: "46984772"
},
usernames: {
gamewisp: "user_name",
twitch: "user_name_twitch"
},
status: "active",
amount: "3.99",
subscribed_at: "2015-12-30 00:00:00",
end_of_access: "2016-01-30 23:59:00",
tier: {
id: "111111",
title: "Tier Title",
level: "1",
cost: "3.99",
description: "Tier description",
published: true
}
}
}
The data object is described as follows:
Property | Type | Description |
---|---|---|
ids | Object | Contains the id and username information of the subscriber. See: Real-Time Events Basics. |
status | String | The subscriber’s current status. Can be any of the following: active - a currently active subscriber trial - a subscriber on a trial code grace_period - a canceled subscriber that is still received benefits billing_grace_period - a canceled subscriber still receiving benefits that was canceled due to a payment processing error inactive - a subscriber that is canceled and receiving no benefits twitch - a subscriber that is receiving free benefits from a partnered Twitch streamer. |
amount | String - US Currency | The amount currently paid by the subscriber. Does not currently include additional money paid by the subscriber over the cost of their subscription tier. |
subscribed_at | String formatted UTC DateTime | The date and time at which the subscriber subscribed to the channel. Is null in the case of an inactive subscriber |
end_of_access | String formatted UTC DateTime | The date and time at which the subscriber is set to be renewed. |
tier | Object | A JSON object describing the tier to which the subsciber is subscribed. |
This event fires as soon as a subscriber has newly subscribed to a channel. It is always immediately followed by the subscriber-benefits-change event.