Note: In Wix-managed headless projects, you don't need to handle visitor tokens manually. The CLI automatically generates and manages visitor tokens for you.
Visitor tokens maintain anonymous visitor sessions, allowing you to track visitor-specific data like shopping cart contents across page visits. Without them, each API call is treated as a new visitor and session data is lost.
When you create a Wix client, visitor tokens are generated automatically. To persist sessions across page loads, store and restore tokens yourself.
For implementation details, see Handle visitors using the JavaScript SDK or Handle visitors using the REST API.