Installation
Install
Section titled “Install”bun add @lastshotlabs/snapshot @tanstack/react-query @tanstack/react-router jotai react react-domOptional peers:
bun add -d vitebun add react-server-dom-webpackCreate A Runtime
Section titled “Create A Runtime”import { createSnapshot } from "@lastshotlabs/snapshot";
export const snap = createSnapshot({ apiUrl: "/api", auth: { session: { mode: "cookie" }, }, loginPath: "/login", homePath: "/",});Wrap Your App
Section titled “Wrap Your App”import { snap } from "./snapshot";
export function AppProviders({ children }: { children: React.ReactNode }) { return <snap.QueryProvider>{children}</snap.QueryProvider>;}Import UI
Section titled “Import UI”import { ButtonBase, CardBase, RichInputBase } from "@lastshotlabs/snapshot/ui";Focused subpaths:
import { RichInputBase } from "@lastshotlabs/snapshot/ui/rich-input";import { EmojiPickerBase } from "@lastshotlabs/snapshot/ui/emoji-picker";import { GifPickerBase } from "@lastshotlabs/snapshot/ui/gif-picker";Sync Backend Types
Section titled “Sync Backend Types”snapshot sync --api http://localhost:3000snapshot sync --file ./schema.json --zodNext Step
Section titled “Next Step”Continue with the Quick Start.