bytetim-knowledge

Integrate ByteTIM traffic identity tickets into Go and Python services via framework middleware.

Updated Apr 30, 2026
One-click install
npx skills add https://github.com/yuezhen-huang/my-bytedance-skillhub --skill bytetim-knowledge-yuezhen-huang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bytetim-knowledge
Source: https://github.com/yuezhen-huang/my-bytedance-skillhub/tree/main/bytetim-knowledge
Command: npx skills add https://github.com/yuezhen-huang/my-bytedance-skillhub --skill bytetim-knowledge-yuezhen-huang

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Integrating ByteDance's ByteTIM traffic identity ticket system requires choosing the correct service role, framework middleware, and initialization order, and mistakes cause missing UserID/DeviceID propagation or failed ticket verification across the RPC chain. ## Core Features & Use Cases - Role-Based SDK Integration: Guides registration and setup for ticket generator versus ticket verifier roles, including version compatibility and user/device type configuration on the ByteTIM management platform. - Framework Middleware Coverage: Provides working code for Ginex, Hertz v0/v1, Kite, KiteX, GDP, and Python Euler frameworks, including session middleware ordering for C-end scenarios. - Custom Parameters & Verification: Shows how to inject custom ticket fields, enable Auth Level and Session App ID, and validate integration via the iesarch.bytetim.client.generate_ticket metrics. - Use Case: A backend engineer building a KiteX RPC service that must propagate user identity downstream can follow the guide to register the PSM, add timkitex middleware, and confirm ticket generation through monitoring metrics. ## Quick Start Ask the agent to show how to integrate the ByteTIM SDK middleware into a KiteX server and verify the integration succeeded.

Frequently Asked Questions about bytetim-knowledge

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate ByteTIM SDK into a KiteX service?

Import code.byted.org/bytetim/client-go/generator/timkitex, call timkitex.MustInit(), then attach timkitex.ByteTIMKiteXMW via client.WithMiddleware for clients or server.WithMiddleware for servers. Register your PSM on the ByteTIM management platform first.

How do I choose between ticket generator and ticket verifier roles?

Ticket generators are entry-point services like HTTP gateways, scripts, or cron jobs that create tickets; verifiers are downstream services that only validate them. If a service does both, register it as a generator.

Does ByteTIM support Python services?

Yes, install byted-bytetim via pip (Python >= 3.6 required). It supports the Euler framework with client and server middleware, plus HTTP header injection via get_or_create_ticket_for_http for script scenarios.

Why must the session middleware come before the ByteTIM middleware?

For C-end user scenarios, ByteTIM reads login state produced by the Passport session library, so session_lib must be initialized first and its middleware registered before the ByteTIM middleware. Non-C-end services do not need session_lib at all.

How do I verify ByteTIM integration is working?

Query the metric iesarch.bytetim.client.generate_ticket.v2 (SDK >= 1.2.18) or iesarch.bytetim.client.generate_ticket for older versions. Check tags result=success, ticket_type=bytetim, and your service PSM in end_psm.

What changed when upgrading ByteTIM Go SDK past v1.2.1?

Package paths were split per framework: the single generator package became timginex, timhertz, timhertzv0, timkite, timkitex, and timgdp, while the verifier moved to verifier/timticket and common utilities to timpkg. Update imports and recompile.