npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@svelte-atproto/sv

v0.1.1

Published

sv add-on that scaffolds @svelte-atproto/oauth into a SvelteKit project. Run `npx sv add @svelte-atproto`.

Readme

@svelte-atproto/sv

sv community add-on that scaffolds @svelte-atproto/oauth into a SvelteKit project — atproto OAuth in one prompt-driven step.

npx sv add @svelte-atproto

(The full form npx sv add @svelte-atproto/sv works too — the @scope/sv shortcut applies.)

[!IMPORTANT] Svelte maintainers have not reviewed community add-ons for malicious code. Use at your discretion.

What you get

After pnpm install + pnpm atproto:setup, you have:

src/
├── hooks.server.ts                        # 2 lines: mounts atproto.handle
├── app.d.ts                               # App.Locals augmented with did/session/client
├── lib/atproto/
│   ├── index.ts                           # createAtprotoAuth config (≈ 12 lines)
│   └── oauth.remote.ts                    # only when demo style = remote
└── routes/demo/atproto/                   # only when demo != none
    ├── +page.svelte
    ├── +page.server.ts
    └── login/{+page.svelte,+page.server.ts}

Plus three npm scripts (atproto:setup, atproto:keygen, atproto:secret) that wrap the lib's CLI for .env generation.

Prompts

storage — where OAuth sessions live

| Value | Notes | |---|---| | memory | dev-only — sessions lost on restart | | cloudflare | use with @sveltejs/adapter-cloudflare (KV bindings) | | upstash | edge-compatible (Vercel/Netlify/CF), HTTP-based | | none | wire your own Store |

demo — what to scaffold at /demo/atproto

| Value | Notes | |---|---| | none | no demo (default) | | login | minimal sign-in / sign-out flow | | statusphere | publishes xyz.statusphere.status records, lists recent statuses globally via UFO. Auto-upgrades the OAuth scope. |

demoStyle — how the demo wires its actions (asked iff demo != none)

| Value | Notes | |---|---| | form | SvelteKit form actions (stable, recommended) | | remote | experimental SvelteKit remote functions; adds kit.experimental.remoteFunctions: true to svelte.config.js and a valibot dep |

Pass options non-interactively

npx sv add @svelte-atproto=storage:cloudflare+demo:statusphere+demoStyle:form

Booleans use yes/no. Selects use the value directly.

What happens after scaffolding

pnpm install            # pulls @svelte-atproto/oauth + valibot (if remote demo)
pnpm atproto:setup      # writes COOKIE_SECRET + CLIENT_ASSERTION_KEY into .env
pnpm dev                # OAuth metadata + jwks + callback all served by atproto.handle

Visit /demo/atproto if you scaffolded a demo; sign in with any handle on a real PDS.

atproto-oauth setup is idempotent — re-running won't clobber existing values. For production, pipe the same generators into your secrets manager:

pnpm atproto:secret | wrangler secret put COOKIE_SECRET
pnpm atproto:keygen | wrangler secret put CLIENT_ASSERTION_KEY

What it doesn't scaffold

  • 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).
  • A login UI component — import { login, logout } from '@svelte-atproto/oauth/client' and call them from your own buttons / forms.
  • 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.

Vite host pin

The 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.

Local development of this add-on

pnpm demo:reset                          # rm -rf demo && fresh sv create
pnpm demo:add:statusphere-form           # cloudflare + statusphere + form actions
pnpm demo:add:statusphere-remote         # cloudflare + statusphere + remote functions
pnpm demo:add:login-form                 # memory + login demo + form actions
pnpm demo:add:login-remote               # memory + login demo + remote functions
pnpm demo:add:bare                       # memory + no demo
pnpm demo:add                            # interactive prompts
pnpm demo:link-lib                       # link demo to a local @svelte-atproto/oauth checkout
pnpm demo:run                            # cd demo && pnpm install && pnpm atproto:setup && pnpm dev

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.

pnpm test                # vitest — covers 3 option combos × kit-ts & kit-js

The 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.

Status

Pre-1.0. The sv add-on API itself is also still experimental — see Svelte's add-on docs.

Issues + PRs welcome at https://github.com/flo-bit/svelte-atproto-sv.

License

MIT