Snapshot
Snapshot is a code-first React SDK for Slingshot-powered apps. Create one runtime
with createSnapshot({ apiUrl }), compose hooks in React, and import UI from
@lastshotlabs/snapshot/ui.
import { createSnapshot } from "@lastshotlabs/snapshot";import { ButtonBase, CardBase } from "@lastshotlabs/snapshot/ui";
const snap = createSnapshot({ apiUrl: "/api",});
function App() { const { user, isLoading } = snap.useUser(); if (isLoading) return null; if (!user) return <LoginPage />;
return ( <CardBase> <h1>Welcome, {user.email}</h1> <ButtonBase label="Open dashboard" /> </CardBase> );}What You Get
Section titled “What You Get”- Auth, MFA, OAuth, passkey, account, community, webhook, WebSocket, SSE, and routing hooks from one runtime instance.
- A low-level API client plus TanStack Query cache access.
- OpenAPI sync for typed API helpers and React Query hooks.
- Standalone UI components with typed props, slots, and Snapshot design tokens.
- Vite helpers for sync, SSR, RSC, PPR, prefetch metadata, and static route metadata.
- CLI commands for scaffolding and sync.
Learning Path
Section titled “Learning Path”Reference
Section titled “Reference”| Need | Where to go |
|---|---|
| Runtime API | SDK Reference |
| UI exports | UI Reference |
| Components | Component Reference |
| Vite plugins | Vite Reference |
| SSR helpers | SSR Reference |
| CLI | CLI Reference |