{"id":20397635,"url":"https://github.com/jwdeveloper/tiktoklivejava","last_synced_at":"2025-04-04T21:10:34.410Z","repository":{"id":186421947,"uuid":"675055277","full_name":"jwdeveloper/TikTokLiveJava","owner":"jwdeveloper","description":"Java implementation of TikTok-Live-Connector library.  Receive live stream events (comments, gifts, etc.) in realtime from TikTok LIVE.","archived":false,"fork":false,"pushed_at":"2025-02-19T19:17:00.000Z","size":20266,"stargazers_count":123,"open_issues_count":1,"forks_count":36,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-28T20:11:16.063Z","etag":null,"topics":["api","api-wrapper","bot","broadcast","chat","connector","live","livestream","package","scraper","stream","tiktok","tiktok-api","tiktok-java","tiktok-live","tiktok-live-java","tiktoklive","webcast","websocket"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jwdeveloper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":"FUNDING.yml","license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"jwdeveloper","custom":["https://www.buymeacoffee.com/jwdev"]}},"created_at":"2023-08-05T16:15:22.000Z","updated_at":"2025-03-25T05:31:26.000Z","dependencies_parsed_at":"2023-10-12T11:11:18.232Z","dependency_job_id":"9042778f-9010-450d-b10f-e781c8056526","html_url":"https://github.com/jwdeveloper/TikTokLiveJava","commit_stats":null,"previous_names":["jwdeveloper/tiktok-live-java"],"tags_count":83,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwdeveloper%2FTikTokLiveJava","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwdeveloper%2FTikTokLiveJava/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwdeveloper%2FTikTokLiveJava/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwdeveloper%2FTikTokLiveJava/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwdeveloper","download_url":"https://codeload.github.com/jwdeveloper/TikTokLiveJava/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249532,"owners_count":20908212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-wrapper","bot","broadcast","chat","connector","live","livestream","package","scraper","stream","tiktok","tiktok-api","tiktok-java","tiktok-live","tiktok-live-java","tiktoklive","webcast","websocket"],"created_at":"2024-11-15T04:15:54.974Z","updated_at":"2025-04-04T21:10:34.392Z","avatar_url":"https://github.com/jwdeveloper.png","language":"Java","funding_links":["https://patreon.com/jwdeveloper","https://www.buymeacoffee.com/jwdev"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\" \u003e\n\u003ca target=\"blank\" \u003e\n\u003cimg src=\"https://raw.githubusercontent.com/jwdeveloper/TikTokLiveJava/develop-1_0_0/Tools-ReadmeGenerator/src/main/resources/logo.svg\" width=\"15%\" \u003e\n\u003c/a\u003e\n\u003c/div\u003e\n\u003cdiv align=\"center\" \u003e\n\u003ch1\u003eTikTok Live Java\u003c/h1\u003e\n\n❤️❤️🎁 *Connect to TikTok live in 3 lines* 🎁❤️❤️\n\n\u003cdiv align=\"center\" \u003e\n\u003ca href=\"https://jitpack.io/#jwdeveloper/TikTok-Live-Java\" target=\"blank\" \u003e\n\u003cimg src=\"https://jitpack.io/v/jwdeveloper/TikTok-Live-Java.svg\" width=\"20%\" \u003e\n\u003c/a\u003e\n\n\n\u003ca href=\"https://discord.gg/e2XwPNTBBr\" target=\"blank\" \u003e\n\u003cimg src=\"https://img.shields.io/badge/Discord-%235865F2.svg?style=for-the-badge\u0026logo=discord\u0026logoColor=white\" \u003e\n\u003c/a\u003e\n\n\u003ca target=\"blank\" \u003e\n\u003cimg src=\"https://img.shields.io/badge/java-%23ED8B00.svg?style=for-the-badge\u0026logo=openjdk\u0026logoColor=white\" \u003e\n\u003c/a\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n# Introduction\nA Java library inspired by [TikTokLive](https://github.com/isaackogan/TikTokLive) and [TikTokLiveSharp](https://github.com/frankvHoof93/TikTokLiveSharp). Use it to receive live stream events such as comments and gifts in realtime from [TikTok LIVE](https://www.tiktok.com/live) by connecting to TikTok's internal WebCast push service.\nThe library includes a wrapper that connects to the WebCast service using just the username (`uniqueId`). This allows you to connect to your own live chat as well as the live chat of other streamers.\nNo credentials are required. Events such as [Members Joining](#member), [Gifts](#gift), [Subscriptions](#subscribe), [Viewers](#roomuser), [Follows](#social), [Shares](#social), [Questions](#questionnew), [Likes](#like) and [Battles](#linkmicbattle) can be tracked.\n\n\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://www.youtube.com/watch?v=eerWGgUKc6c\" align=\"right\" target=\"blank\"\u003e\u003cimg src=\"https://img.youtube.com/vi/eerWGgUKc6c/hqdefault.jpg\" alt=\"IMAGE ALT TEXT\" width=\"38%\" align=\"right\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\nJoin the support [discord](https://discord.gg/e2XwPNTBBr) and visit the `#java-support` channel for questions, contributions and ideas. Feel free to make pull requests with missing/new features, fixes, etc\n\nDo you prefer other programming languages?\n- **Node** orginal: [TikTok-Live-Connector](https://github.com/isaackogan/TikTok-Live-Connector) by [@zerodytrash](https://github.com/zerodytrash)\n- **Rust** rewrite: [TikTokLiveRust](https://github.com/jwdeveloper/TikTokLiveRust)\n- **Python** rewrite: [TikTokLive](https://github.com/isaackogan/TikTokLive) by [@isaackogan](https://github.com/isaackogan)\n- **Go** rewrite: [GoTikTokLive](https://github.com/Davincible/gotiktoklive) by [@Davincible](https://github.com/Davincible)\n- **C#** rewrite: [TikTokLiveSharp](https://github.com/frankvHoof93/TikTokLiveSharp) by [@frankvHoof93](https://github.com/frankvHoof93)\n\n**NOTE:** This is not an official API. It's a reverse engineering project.\n\n#### Overview\n- [Getting started](#getting-started)\n- [Events](#events)\n- [Extensions](#extensions)\n- [Listeners](#listeners)\n- [Contributing](#contributing)\n\n## Getting started\n\n1. Install the package\n\nMaven\n```xml\n   \u003crepositories\u003e\n        \u003crepository\u003e\n            \u003cid\u003ejitpack.io\u003c/id\u003e\n            \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n        \u003c/repository\u003e\n    \u003c/repositories\u003e\n\n   \u003cdependencies\u003e\n         \u003cdependency\u003e\n            \u003cgroupId\u003ecom.github.jwdeveloper.TikTok-Live-Java\u003c/groupId\u003e\n            \u003cartifactId\u003eClient\u003c/artifactId\u003e\n             \u003cversion\u003e1.9.2-Release\u003c/version\u003e\n            \u003cscope\u003ecompile\u003c/scope\u003e\n        \u003c/dependency\u003e\n   \u003c/dependencies\u003e\n```\n\nGradle\n```gradle\ndependencyResolutionManagement {\n\t\trepositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)\n\t\trepositories {\n\t\t\tmavenCentral()\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n\ndependencies {\n\t        implementation 'com.github.jwdeveloper.TikTok-Live-Java:Client:1.9.2-Release'\n\t}\n```\n\n2. Create your first chat connection\n\n```java\n\nTikTokLive.newClient(\"bangbetmenygy\")\n        .onGift((liveClient, event) -\u003e\n        {\n            String message = switch (event.getGift()) {\n                case ROSE -\u003e \"ROSE!\";\n                case GG -\u003e \"GOOD GAME\";\n                case TIKTOK -\u003e \"Ye\";\n                case CORGI -\u003e \"Nice gift\";\n                default -\u003e \"Thank you for \" + event.getGift().getName();\n            };\n            System.out.println(event.getUser().getProfileName() + \" sends \" + message);\n        })\n        .onGiftCombo((liveClient, event) -\u003e\n        {\n            System.out.println(event.getComboState()+ \" \" + event.getCombo() + \" \" + event.getGift().getName());\n        })\n        .onRoomInfo((liveClient, event) -\u003e\n        {\n            var roomInfo = event.getRoomInfo();\n            System.out.println(\"Room Id: \"+roomInfo.getRoomId());\n            System.out.println(\"Likes: \"+roomInfo.getLikesCount());\n            System.out.println(\"Viewers: \"+roomInfo.getViewersCount());\n        })\n        .onJoin((liveClient, event) -\u003e\n        {\n            System.out.println(event.getUser().getProfileName() + \"Hello on my stream! \");\n        })\n        .onConnected((liveClient, event) -\u003e\n        {\n            System.out.println(\"Connected to live \");\n        })\n        .onError((liveClient, event) -\u003e\n        {\n            System.out.println(\"Error! \" + event.getException().getMessage());\n        })\n        .buildAndConnect();\n\n```\n3. Configure (optional)\n\n```java\n\n        TikTokLive.newClient(\"bangbetmenygy\")\n                .configure((settings) -\u003e\n                {\n                    settings.setHostName(\"bangbetmenygy\"); // This method is useful in case you want change hostname later\n                    settings.setClientLanguage(\"en\"); // Language\n                    settings.setTimeout(Duration.ofSeconds(2)); // Connection timeout\n                    settings.setLogLevel(Level.ALL); // Log level\n                    settings.setPrintToConsole(true); // Printing all logs to console even if log level is Level.OFF\n                    settings.setRetryOnConnectionFailure(true); // Reconnecting if TikTok user is offline\n                    settings.setRetryConnectionTimeout(Duration.ofSeconds(1)); // Timeout before next reconnection\n\n                    //Optional: Sometimes not every message from chat are send to TikTokLiveJava to fix this issue you can set sessionId\n                    // documentation how to obtain sessionId https://github.com/isaackogan/TikTok-Live-Connector#send-chat-messages\n                    settings.setSessionId(\"86c3c8bf4b17ebb2d74bb7fa66fd0000\");\n\n                    //Optional:\n                    //RoomId can be used as an override if you're having issues with HostId.\n                    //You can find it in the HTML for the livestream-page\n                    settings.setRoomId(\"XXXXXXXXXXXXXXXXX\");\n                })\n                .buildAndConnect();\n        //  \n```\n\n\n## Events\n\n\n\n## Events\n\n\n\n**Control**:\n\n- [onReconnecting](#onreconnecting-tiktokreconnectingevent)\n- [onError](#onerror-tiktokerrorevent)\n- [onConnected](#onconnected-tiktokconnectedevent)\n- [onDisconnected](#ondisconnected-tiktokdisconnectedevent)\n\n**Message**:\n\n- [onEvent](#onevent-tiktokevent)\n- [onEvent](#onevent-tiktokevent)\n- [onComment](#oncomment-tiktokcommentevent)\n- [onRoomInfo](#onroominfo-tiktokroominfoevent)\n- [onGift](#ongift-tiktokgiftevent)\n- [onSubscribe](#onsubscribe-tiktoksubscribeevent)\n- [onFollow](#onfollow-tiktokfollowevent)\n- [onGiftCombo](#ongiftcombo-tiktokgiftcomboevent)\n- [onLiveEnded](#onliveended-tiktokliveendedevent)\n- [onQuestion](#onquestion-tiktokquestionevent)\n- [onShare](#onshare-tiktokshareevent)\n- [onLiveUnpaused](#onliveunpaused-tiktokliveunpausedevent)\n- [onEmote](#onemote-tiktokemoteevent)\n- [onJoin](#onjoin-tiktokjoinevent)\n- [onLike](#onlike-tiktoklikeevent)\n- [onLivePaused](#onlivepaused-tiktoklivepausedevent)\n\n**Debug**:\n\n- [onWebsocketResponse](#onwebsocketresponse-tiktokwebsocketresponseevent)\n- [onWebsocketUnhandledMessage](#onwebsocketunhandledmessage-tiktokwebsocketunhandledmessageevent)\n- [onHttpResponse](#onhttpresponse-tiktokhttpresponseevent)\n- [onWebsocketMessage](#onwebsocketmessage-tiktokwebsocketmessageevent)\n# Examples\n\u003cbr\u003e\n\n## onReconnecting [TikTokReconnectingEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokReconnectingEvent.java)\n\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onReconnecting((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onError [TikTokErrorEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokErrorEvent.java)\n\n\nGeneral error event. You should handle this.\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onError((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onConnected [TikTokConnectedEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokConnectedEvent.java)\n\n\nTriggered when the connection is successfully established.\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onConnected((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onDisconnected [TikTokDisconnectedEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokDisconnectedEvent.java)\n\n\nTriggered when the connection gets disconnected. In that case you can call connect() again to have a reconnect logic.\nNote that you should wait a little bit before attempting a reconnect to to avoid being rate-limited.\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onDisconnected((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onEvent [TikTokEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/common/TikTokEvent.java)\n\n\nBase class for all events\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onEvent((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onEvent [TikTokEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/common/TikTokEvent.java)\n\n\nBase class for all events\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onEvent((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onComment [TikTokCommentEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokCommentEvent.java)\n\n\nTriggered every time a new chat comment arrives.\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onComment((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onRoomInfo [TikTokRoomInfoEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/room/TikTokRoomInfoEvent.java)\n\n\nTriggered when LiveRoomInfo got updated such as likes, viewers, ranking ....\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onRoomInfo((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onGift [TikTokGiftEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/gift/TikTokGiftEvent.java)\n\n\nTriggered when user sends gifts that has\nno combo (most of expensive gifts)\nor if combo has finished\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onGift((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onSubscribe [TikTokSubscribeEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokSubscribeEvent.java)\n\n\nTriggers when a user creates a subscription.\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onSubscribe((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onFollow [TikTokFollowEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/social/TikTokFollowEvent.java)\n\n\nTriggers when a user follows the streamer. Based on social event.\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onFollow((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onGiftCombo [TikTokGiftComboEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/gift/TikTokGiftComboEvent.java)\n\n\nTriggered every time gift is sent\n\n@see GiftSendType it has 3 states\n\n  \u003cp\u003eExample when user sends gift with combo\u003c/p\u003e\n  \u003cp\u003e\u003eCombo: 1  -\u003e comboState = GiftSendType.Begin\u003c/p\u003e\n  \u003cp\u003eCombo: 4 -\u003e comboState = GiftSendType.Active\u003c/p\u003e\n  \u003cp\u003eCombo: 8 -\u003e comboState = GiftSendType.Active\u003c/p\u003e\n  \u003cp\u003eCombo: 12 -\u003e comboState = GiftSendType.Finished\u003c/p\u003e\n  \u003cp\u003e\n  Remember if comboState is Finished both TikTokGiftComboEvent and TikTokGiftEvent event gets triggered\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onGiftCombo((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onLiveEnded [TikTokLiveEndedEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokLiveEndedEvent.java)\n\n\nTriggered when the live stream gets terminated by the host. Will also trigger the TikTokDisconnectedEvent event.\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onLiveEnded((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onQuestion [TikTokQuestionEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokQuestionEvent.java)\n\n\nTriggered every time someone asks a new question via the question feature.\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onQuestion((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onShare [TikTokShareEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/social/TikTokShareEvent.java)\n\n\nTriggers when a user shares the stream. Based on social event.\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onShare((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onLiveUnpaused [TikTokLiveUnpausedEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokLiveUnpausedEvent.java)\n\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onLiveUnpaused((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onEmote [TikTokEmoteEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokEmoteEvent.java)\n\n\nTriggered every time a subscriber sends an emote (sticker).\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onEmote((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onJoin [TikTokJoinEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/social/TikTokJoinEvent.java)\n\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onJoin((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onLike [TikTokLikeEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/social/TikTokLikeEvent.java)\n\n\nTriggered when a viewer sends likes to the streamer. For streams with many viewers, this event is not always triggered by TikTok.\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onLike((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onLivePaused [TikTokLivePausedEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/TikTokLivePausedEvent.java)\n\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onLivePaused((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onWebsocketResponse [TikTokWebsocketResponseEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/websocket/TikTokWebsocketResponseEvent.java)\n\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onWebsocketResponse((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onWebsocketUnhandledMessage [TikTokWebsocketUnhandledMessageEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/websocket/TikTokWebsocketUnhandledMessageEvent.java)\n\n\nTriggered every time a protobuf encoded webcast message arrives. You can deserialize the binary object depending on the use case.\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onWebsocketUnhandledMessage((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onHttpResponse [TikTokHttpResponseEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/http/TikTokHttpResponseEvent.java)\n\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onHttpResponse((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\u003cbr\u003e\n\n## onWebsocketMessage [TikTokWebsocketMessageEvent](https://github.com/jwdeveloper/TikTokLiveJava/blob/master/API/src/main/java/io/github/jwdeveloper/tiktok/data/events/websocket/TikTokWebsocketMessageEvent.java)\n\n\nTriggered every time TikTok sends data. Data incoming as protobuf message.\nYou can deserialize the binary object depending on the use case.\n\n\n```java\nTikTokLive.newClient(\"host-name\")\n.onWebsocketMessage((liveClient, event) -\u003e\n{\n\n})\n.buildAndConnect();\n```\n\n\n\n\n\n\n\u003cbr\u003e\n\n\n## Extensions\n\nList of extensions (addons) to TiktokLiveJava\nthat will save your time\n\n- [Video Recorder](https://github.com/jwdeveloper/TikTokLiveJava/tree/master/extension-recorder)\n- [Live data collector to database](https://github.com/jwdeveloper/TikTokLiveJava/tree/master/extension-collector)\n\n\n\n## Listeners\n\n```java\n\n/**\n *\n *  Listeners are an alternative way of handling events.\n *  I would to suggest to use then when logic of handing event\n *  is more complex\n *\n */\npublic static void main(String[] args) throws IOException {\n        showLogo();\n        CustomListener customListener = new CustomListener();\n\n        TikTokLive.newClient(SimpleExample.TIKTOK_HOSTNAME)\n        .addListener(customListener)\n        .buildAndConnect();\n        System.in.read();\n        }\n\n/**\n *\n *  Method in TikTokEventListener should meet 4 requirements to be detected\n *         - must have @TikTokEventHandler annotation\n *         - must have 2 parameters\n *         - first parameter must be LiveClient\n *         - second must be class that extending TikTokEvent\n */\n\npublic static class CustomListener {\n\n    @TikTokEventObserver\n    public void onLike(LiveClient liveClient, TikTokLikeEvent event) {\n        System.out.println(event.toString());\n    }\n\n    @TikTokEventObserver\n    public void onError(LiveClient liveClient, TikTokErrorEvent event) {\n        //  event.getException().printStackTrace();\n    }\n\n    @TikTokEventObserver\n    public void onComment(LiveClient liveClient, TikTokCommentEvent event) {\n        var userName = event.getUser().getName();\n        var text = event.getText();\n        liveClient.getLogger().info(userName + \": \" + text);\n    }\n\n    @TikTokEventObserver\n    public void onGift(LiveClient liveClient, TikTokGiftEvent event) {\n        var message = switch (event.getGift()) {\n            case ROSE -\u003e \"Thanks :)\";\n            case APPETIZERS -\u003e \":OO\";\n            case APRIL -\u003e \":D\";\n            case TIKTOK -\u003e \":P\";\n            case CAP -\u003e \":F\";\n            default -\u003e \":I\";\n        };\n        liveClient.getLogger().info(message);\n    }\n\n    @TikTokEventHandler\n    public void onAnyEvent(LiveClient liveClient, TikTokEvent event) {\n        liveClient.getLogger().info(event.getClass().getSimpleName());\n    }\n\n}\n\n```\n\n\n## Contributing\n\n[Library documentation for contributors](https://github.com/jwdeveloper/TikTokLiveJava/wiki)\n\nYour improvements are welcome! Feel free to open an \u003ca href=\"https://github.com/jwdeveloper/TikTok-Live-Java/issues\"\u003eissue\u003c/a\u003e or \u003ca href=\"https://github.com/jwdeveloper/TikTok-Live-Java/pulls\"\u003epull request\u003c/a\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwdeveloper%2Ftiktoklivejava","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwdeveloper%2Ftiktoklivejava","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwdeveloper%2Ftiktoklivejava/lists"}