File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { writeFileSync } from "node:fs" ;
22import { resolve , dirname } from "node:path" ;
33import { fileURLToPath } from "node:url" ;
4- import { DOC_SECTIONS } from "../src/lib/docs-pages.js " ;
4+ import { DOC_SECTIONS } from "../src/lib/docs-pages" ;
55
66const __dirname = dirname ( fileURLToPath ( import . meta. url ) ) ;
77
Original file line number Diff line number Diff line change 11[
22 {
3- "text" : " Learn " ,
3+ "text" : " Home " ,
44 "items" : [
55 {
6- "text" : " Introduction " ,
6+ "text" : " Home " ,
77 "link" : " /snap"
88 },
99 {
10- "text" : " Examples " ,
11- "link" : " /snap/examples "
10+ "text" : " Building Snaps with AI " ,
11+ "link" : " /snap/agents "
1212 }
1313 ]
1414 },
1515 {
16- "text" : " Create " ,
16+ "text" : " Learn " ,
1717 "items" : [
1818 {
1919 "text" : " Building a Snap" ,
2020 "link" : " /snap/building"
21- }
22- ]
23- },
24- {
25- "text" : " Integrate" ,
26- "items" : [
21+ },
2722 {
28- "text" : " Adding a Snap to an Existing Website" ,
29- "link" : " /snap/existing-site"
23+ "text" : " Integrating Snaps" ,
24+ "link" : " /snap/integrating"
25+ },
26+ {
27+ "text" : " Persistent State" ,
28+ "link" : " /snap/persistent-state"
29+ },
30+ {
31+ "text" : " Examples" ,
32+ "link" : " /snap/examples"
3033 }
3134 ]
3235 },
3336 {
34- "text" : " Reference " ,
37+ "text" : " Snap Protocol " ,
3538 "items" : [
39+ {
40+ "text" : " Overview" ,
41+ "link" : " /snap/protocol"
42+ },
3643 {
3744 "text" : " Elements" ,
3845 "link" : " /snap/elements"
4148 "text" : " Buttons" ,
4249 "link" : " /snap/buttons"
4350 },
44- {
45- "text" : " Actions" ,
46- "link" : " /snap/actions"
47- },
4851 {
4952 "text" : " Effects" ,
5053 "link" : " /snap/effects"
5154 },
52- {
53- "text" : " Constraints" ,
54- "link" : " /snap/constraints"
55- },
5655 {
5756 "text" : " Theme & Styling" ,
5857 "link" : " /snap/theme"
6261 "link" : " /snap/colors"
6362 },
6463 {
65- "text" : " Authentication " ,
66- "link" : " /snap/auth "
64+ "text" : " Actions " ,
65+ "link" : " /snap/actions "
6766 },
6867 {
69- "text" : " Data Store" ,
70- "link" : " /snap/data-store"
71- }
72- ]
73- },
74- {
75- "text" : " Agents" ,
76- "items" : [
68+ "text" : " Constraints" ,
69+ "link" : " /snap/constraints"
70+ },
7771 {
78- "text" : " Agents " ,
79- "link" : " /snap/agents "
72+ "text" : " Authentication " ,
73+ "link" : " /snap/auth "
8074 }
8175 ]
8276 }
Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ use https://docs.farcaster.xyz/snap/SKILL.md to build me an app that
1919 manual implementation with the template.
2020- [ Integrating Snaps] ( /integrating ) — How to serve snap JSON alongside your normal site
2121 using content negotiation on the ` Accept ` header.
22+ - [ Persistent State] ( /persistent-state ) — The key-value store available on every snap
23+ handler invocation for persisting state between requests.
2224- [ Examples] ( /examples ) — Sample snap response payloads showing common UI patterns.
2325
2426## Reference
@@ -37,8 +39,6 @@ use https://docs.farcaster.xyz/snap/SKILL.md to build me an app that
3739 bars, and bar charts.
3840- [ Authentication] ( /auth ) — How POST requests are authenticated with JSON Farcaster
3941 Signatures (JFS) and how servers verify them.
40- - [ Data Store] ( /data-store ) — The key-value store available on every snap handler
41- invocation for persisting state between requests.
4242
4343## Agents
4444
Original file line number Diff line number Diff line change 1- # Data Store
1+ # Persistent State
22
3- Snaps can persist data between requests using a key-value data store. The store is
4- available on every snap handler invocation through ` ctx.data ` .
3+ Snaps created with SKILL.md use Neynar hosting and have built-in data storage. They can
4+ persist data between requests using a key-value data store. The store is available on
5+ every snap handler invocation through ` ctx.data ` .
56
67``` ts
78const snap: SnapFunction = async (ctx ) => {
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ const SECTION_APP_FOLDER: Record<string, string> = {
1717 "Snap Protocol" : "(reference)" ,
1818} ;
1919
20+ // NOTE: keep this in sync with snap-sidebar.json and apps/docs/src/app/(docs)/(learn)/page.mdx
2021export const DOC_SECTIONS : DocSection [ ] = [
2122 {
2223 title : "Home" ,
@@ -31,6 +32,7 @@ export const DOC_SECTIONS: DocSection[] = [
3132 pages : [
3233 { pathname : "/building" , title : "Building a Snap" } ,
3334 { pathname : "/integrating" , title : "Integrating Snaps" } ,
35+ { pathname : "/persistent-state" , title : "Persistent State" } ,
3436 { pathname : "/examples" , title : "Examples" } ,
3537 ] ,
3638 } ,
@@ -46,7 +48,6 @@ export const DOC_SECTIONS: DocSection[] = [
4648 { pathname : "/actions" , title : "Actions" } ,
4749 { pathname : "/constraints" , title : "Constraints" } ,
4850 { pathname : "/auth" , title : "Authentication" } ,
49- { pathname : "/data-store" , title : "Persistent State" } ,
5051 ] ,
5152 } ,
5253] ;
You can’t perform that action at this time.
0 commit comments