Back to Blog
Web Lenses4 min readDecember 5, 2026

Behind the Scenes of My First Web Lens

How I engineered a 60fps Canvas game under 8 MB with @snap/web-lens-api leaderboards, safe-area HUDs, and instant browser play.

#web-lens#canvas#leaderboards#vite

Snapchat Web Lenses unlock something magical: full HTML5 Canvas and WebGL games that launch inside Snapchat without needing a camera feed—and run just as smoothly inside a mobile browser viewport on this portfolio.

In full-screen play, Snapchat overlays its close button in the top-left 64 × 64 CSS pixel corner. Placing score pills on the right edge and keeping interactive tap targets safely inside the middle arena ensures zero accidental exits during fast reflex runs.

Studio Pipeline Visual

Vite Build → Unbundled snap-api.js → 10 KB Production ZIP

Neon Pulse Tap compiles to just 0.010 MB including the unbundled @snap/web-lens-api bridge.

2. Leaderboards & Persistent Best Scores

Integrating @snap/web-lens-api lets the game call snapchat.leaderboards.submitScore({ score }) as soon as a 20-second run ends, while storing personal high scores via snapchat.storage instead of localStorage.