How eitaar/snapi works
This is an experimental operator-facing CLI and TypeScript client for one or more Snapchat Web sessions. The principal workflow selects an account, loads and validates its sealed session and build, initializes Snapchat’s pinned messaging runtime, obtains request authentication, then sends or watches Chat/Snap traffic through gRPC-Web and Gateway. Separate workflows register profiles, import or refresh session state from browser exports/HARs, and inspect friends. The README documents automatic SSO renewal and Web-session heartbeats. Edges reflect README statements or shown imports/calls; several command-specific implementations and runtime internals were not sampled, so uncertain wiring is omitted.
Main entry points: client.ts Client composition · index.ts Command dispatcher · session-refresh-har.ts Session commands · grpc-client.ts gRPC-Web transport
Components 21
CLI and profiles
- Command dispatcher
src/cli/index.ts - Account profiles
src/accounts/profile-store.ts - Configuration
src/config.ts
Session lifecycle
- Session commands
src/cli/commands/session-refresh-har.ts - Sealed session store
src/session/sealed-store.ts - Browser export
src/browser/cdp.ts - HAR authentication import
src/session/har-auth.ts
Messaging runtime
- Build compatibility
src/compat/guard.ts - Pinned official runtime
src/runtime/official-worker-entry.ts - Runtime client
src/runtime/worker-client.ts
Product capabilities
- Client composition
src/client.ts - Chat messaging
src/messaging/client.ts - Snap media
src/media/client.ts - Friends snapshots
src/friends/snapshot.ts - Gateway events
src/gateway/client.ts
Authentication and network
- Request auth
src/transport/auth-provider.ts - Web attestation
src/auth/web-attestation.ts - SSO renewal
src/transport/sso-auth-refresh.ts - gRPC-Web transport
src/transport/grpc-client.ts
Other components
- Operator
- Snapchat services
Connections 28
- Operator → Command dispatcher: runs commands
README.md - Command dispatcher → Configuration: resolves settings
src/cli/index.ts - Command dispatcher → Account profiles: selects profiles
src/cli/index.ts - Configuration → Sealed session store: loads session
src/config.ts - Command dispatcher → Session commands: dispatches session
src/cli/index.ts - Session commands → HAR authentication import: imports HAR auth
README.md - Session commands → Browser export: exports browser state
README.md - Session commands → Sealed session store: persists session
README.md - Command dispatcher → Client composition: creates client
src/cli/index.ts - Client composition → Sealed session store: reads session
src/client.ts - Client composition → Build compatibility: validates build
src/client.ts - Client composition → Runtime client: initializes runtime
src/client.ts - Runtime client → Pinned official runtime: dispatches runtime calls
src/runtime/worker-client.ts - Client composition → Chat messaging: composes messaging
src/client.ts - Client composition → Snap media: composes media
src/client.ts - Client composition → Friends snapshots: composes friends
src/client.ts - Client composition → Gateway events: composes gateway
src/client.ts - Chat messaging → Runtime client: encrypts content
README.md - Snap media → Runtime client: protects Snap content
README.md - Chat messaging → gRPC-Web transport: sends messages
src/messaging/client.ts - Snap media → gRPC-Web transport: transfers media
src/media/client.ts - Friends snapshots → Snapchat services: requests friend data
- gRPC-Web transport → Request auth: gets request auth
src/transport/grpc-client.ts - Request auth → SSO renewal: refreshes credentials
README.md - SSO renewal → Web attestation: requests attestation
README.md - gRPC-Web transport → Snapchat services: calls private API
README.md - Gateway events → Snapchat services: connects WebSocket
src/gateway/client.ts - Gateway events → Request auth: authenticates reconnect
README.md