tiksync

package module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 20 Imported by: 0

README

TikSync

TikSync Go SDK

TikTok Live SDK for Go - Real-time chat, gifts, likes, follows & viewer events.
Website - Documentation - Pricing


Installation

go get github.com/tiksync/tiksync-go

Quick Start

package main

import (
    "fmt"
    tiksync "github.com/tiksync/tiksync-go"
)

func main() {
    client := tiksync.New("username", "your_api_key")

    client.On("chat", func(data map[string]interface{}) {
        fmt.Printf("[%s] %s\n", data["uniqueId"], data["comment"])
    })

    client.On("gift", func(data map[string]interface{}) {
        fmt.Printf("%s sent %s x%v\n", data["uniqueId"], data["giftName"], data["repeatCount"])
    })

    client.On("follow", func(data map[string]interface{}) {
        fmt.Printf("%s followed!\n", data["uniqueId"])
    })

    client.Connect()
}

Configuration

client := tiksync.NewWithConfig("username", tiksync.Config{
    APIKey:               "your_api_key",
    APIURL:               "https://api.tik-sync.com",
    MaxReconnectAttempts: 5,
    ReconnectDelay:       5 * time.Second,
})

Events

Event Description
connected Connected to stream
chat Chat message received
gift Gift received (with diamond count, streak info)
like Likes received
follow New follower
share Stream shared
member User joined the stream
roomUser Viewer count update
streamEnd Stream ended
disconnected Disconnected
error Connection error

Get Started

  1. Sign up at tik-sync.com
  2. Create a free API key in your dashboard
  3. Install the SDK and start building

Free tier available. See pricing for details.

Why TikSync?

  • < 1ms signature latency
  • $0 CAPTCHA cost
  • Rust-powered native backend
  • 6 official SDKs - JS, Python, Go, Java, C#, Rust
  • Direct connection - no proxy required

License

MIT - Built by 0xwolfsync

Documentation

Index

Constants

View Source
const DefaultAPIURL = "https://api.tik-sync.com"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	APIKey               string
	APIURL               string
	MaxReconnectAttempts int
	ReconnectDelay       time.Duration
}

type EventHandler

type EventHandler func(data map[string]interface{})

type SecurityCore

type SecurityCore struct {
	// contains filtered or unexported fields
}

type TikSync

type TikSync struct {
	// contains filtered or unexported fields
}

func New

func New(uniqueID string, apiKey string) *TikSync

func NewWithConfig

func NewWithConfig(uniqueID string, config Config) *TikSync

func (*TikSync) Connect

func (t *TikSync) Connect() error

func (*TikSync) Disconnect

func (t *TikSync) Disconnect()

func (*TikSync) On

func (t *TikSync) On(event string, handler EventHandler) *TikSync

Directories

Path Synopsis
cmd
test command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL