Skip to content

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>
);
}
  • 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.
  1. Installation
  2. Quick Start
  3. Core Concepts
  4. Authentication
  5. Component Overview
  6. SSR and RSC
NeedWhere to go
Runtime APISDK Reference
UI exportsUI Reference
ComponentsComponent Reference
Vite pluginsVite Reference
SSR helpersSSR Reference
CLICLI Reference