Skip to main content

Topic - Commerce Events

Description

This topic is deprecated by Twitch, but it could be used to monitor purchases in a specified channel.

Method Definition

Required Parameters

NameTypeDescription
credentialOAuth2CredentialUser Auth Token for the target channel id, with any scope
channelIdStringTarget Channel Id

Optional Parameters

None

Code-Snippets

Subscribe to all commerce purchases in the twitch4j channel and register a listener that prints all messages to console

twitchClient.getPubSub().listenForCommerceEvents(credential, "149223493");

twitchClient.getEventManager().onEvent(ChannelCommerceEvent.class, System.out::println);