{"id":50495001,"url":"https://github.com/flo-bit/svelte-atproto-sv","last_synced_at":"2026-06-02T06:04:38.254Z","repository":{"id":356389130,"uuid":"1232108232","full_name":"flo-bit/svelte-atproto-sv","owner":"flo-bit","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-23T03:17:19.000Z","size":70,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-23T05:12:43.886Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flo-bit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-07T15:41:33.000Z","updated_at":"2026-05-23T03:16:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/flo-bit/svelte-atproto-sv","commit_stats":null,"previous_names":["flo-bit/svelte-atproto-sv"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/flo-bit/svelte-atproto-sv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flo-bit%2Fsvelte-atproto-sv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flo-bit%2Fsvelte-atproto-sv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flo-bit%2Fsvelte-atproto-sv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flo-bit%2Fsvelte-atproto-sv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flo-bit","download_url":"https://codeload.github.com/flo-bit/svelte-atproto-sv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flo-bit%2Fsvelte-atproto-sv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33808708,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-02T06:04:37.581Z","updated_at":"2026-06-02T06:04:38.246Z","avatar_url":"https://github.com/flo-bit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `@svelte-atproto/sv`\n\n[`sv`](https://svelte.dev/docs/cli/overview) community add-on that scaffolds [`@svelte-atproto/oauth`](https://www.npmjs.com/package/@svelte-atproto/oauth) into a SvelteKit project — atproto OAuth in one prompt-driven step.\n\n```sh\nnpx sv add @svelte-atproto\n```\n\n(The full form `npx sv add @svelte-atproto/sv` works too — the `@scope/sv` shortcut applies.)\n\n\u003e [!IMPORTANT]\n\u003e Svelte maintainers have not reviewed community add-ons for malicious code. Use at your discretion.\n\n## What you get\n\nAfter `pnpm install` + `pnpm atproto:setup`, you have:\n\n```\nsrc/\n├── hooks.server.ts                        # 2 lines: mounts atproto.handle\n├── app.d.ts                               # App.Locals augmented with did/session/client\n├── lib/atproto/\n│   ├── index.ts                           # createAtprotoAuth config (≈ 12 lines)\n│   └── oauth.remote.ts                    # only when demo style = remote\n└── routes/demo/atproto/                   # only when demo != none\n    ├── +page.svelte\n    ├── +page.server.ts\n    └── login/{+page.svelte,+page.server.ts}\n```\n\nPlus three npm scripts (`atproto:setup`, `atproto:keygen`, `atproto:secret`) that wrap the lib's CLI for `.env` generation.\n\n## Prompts\n\n### `storage` — where OAuth sessions live\n\n| Value | Notes |\n|---|---|\n| `memory` | dev-only — sessions lost on restart |\n| `cloudflare` | use with `@sveltejs/adapter-cloudflare` (KV bindings) |\n| `upstash` | edge-compatible (Vercel/Netlify/CF), HTTP-based |\n| `none` | wire your own `Store` |\n\n### `demo` — what to scaffold at `/demo/atproto`\n\n| Value | Notes |\n|---|---|\n| `none` | no demo (default) |\n| `login` | minimal sign-in / sign-out flow |\n| `statusphere` | publishes `xyz.statusphere.status` records, lists recent statuses globally via UFO. Auto-upgrades the OAuth scope. |\n\n### `demoStyle` — how the demo wires its actions (asked iff `demo != none`)\n\n| Value | Notes |\n|---|---|\n| `form` | SvelteKit form actions (stable, recommended) |\n| `remote` | experimental SvelteKit remote functions; adds `kit.experimental.remoteFunctions: true` to `svelte.config.js` and a `valibot` dep |\n\n## Pass options non-interactively\n\n```sh\nnpx sv add @svelte-atproto=storage:cloudflare+demo:statusphere+demoStyle:form\n```\n\nBooleans use `yes`/`no`. Selects use the value directly.\n\n## What happens after scaffolding\n\n```sh\npnpm install            # pulls @svelte-atproto/oauth + valibot (if remote demo)\npnpm atproto:setup      # writes COOKIE_SECRET + CLIENT_ASSERTION_KEY into .env\npnpm dev                # OAuth metadata + jwks + callback all served by atproto.handle\n```\n\nVisit `/demo/atproto` if you scaffolded a demo; sign in with any handle on a real PDS.\n\n`atproto-oauth setup` is idempotent — re-running won't clobber existing values. For production, pipe the same generators into your secrets manager:\n\n```sh\npnpm atproto:secret | wrangler secret put COOKIE_SECRET\npnpm atproto:keygen | wrangler secret put CLIENT_ASSERTION_KEY\n```\n\n## What it doesn't scaffold\n\n- A global `+layout.server.ts` — auth state lives on `event.locals.{ did, session, client }`. Per-route loads pass it forward as needed (see the demo's `+page.server.ts`).\n- A login UI component — `import { login, logout } from '@svelte-atproto/oauth/client'` and call them from your own buttons / forms.\n- A `wrangler.jsonc` patch for KV bindings (yet) — if you picked `storage: cloudflare`, you still need to add the bindings yourself. Coming in a future release.\n\n## Vite host pin\n\nThe addon adds `server: { host: '127.0.0.1' }` to `vite.config.ts/.js`. OAuth loopback (RFC 8252 §7.3) requires the literal IPv4 loopback, not the hostname `localhost` — without this pin the PDS callback to `127.0.0.1:5173` gets `ECONNREFUSED` on systems where `localhost` resolves to `::1`.\n\n## Local development of this add-on\n\n```sh\npnpm demo:reset                          # rm -rf demo \u0026\u0026 fresh sv create\npnpm demo:add:statusphere-form           # cloudflare + statusphere + form actions\npnpm demo:add:statusphere-remote         # cloudflare + statusphere + remote functions\npnpm demo:add:login-form                 # memory + login demo + form actions\npnpm demo:add:login-remote               # memory + login demo + remote functions\npnpm demo:add:bare                       # memory + no demo\npnpm demo:add                            # interactive prompts\npnpm demo:link-lib                       # link demo to a local @svelte-atproto/oauth checkout\npnpm demo:run                            # cd demo \u0026\u0026 pnpm install \u0026\u0026 pnpm atproto:setup \u0026\u0026 pnpm dev\n```\n\n`demo:link-lib` defaults to a sibling clone at `../../svelte-atproto-oauth`. Override with `ATPROTO_OAUTH_LIB_PATH=/abs/path pnpm demo:link-lib` if your checkouts live elsewhere.\n\n```sh\npnpm test                # vitest — covers 3 option combos × kit-ts \u0026 kit-js\n```\n\nThe test suite injects `pnpm.overrides` to point at a local lib checkout when one exists (sibling dir or `ATPROTO_OAUTH_LIB_PATH`); otherwise it resolves `@svelte-atproto/oauth` from npm — which is what CI does, so CI exercises the real published version end-to-end.\n\n## Status\n\nPre-1.0. The `sv` add-on API itself is also still experimental — see [Svelte's add-on docs](https://svelte.dev/docs/cli/community).\n\nIssues + PRs welcome at \u003chttps://github.com/flo-bit/svelte-atproto-sv\u003e.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflo-bit%2Fsvelte-atproto-sv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflo-bit%2Fsvelte-atproto-sv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflo-bit%2Fsvelte-atproto-sv/lists"}