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

@hostily/captcha-svelte

v0.2.0

Published

Svelte 4 and 5 component for hostily Captcha (captcha.hostily.de): thin wrapper around the <hostily-captcha> web component. SSR-safe (SvelteKit).

Readme

@hostily/captcha-svelte

Deutsch

Svelte-Komponente (Svelte 4 und 5) für hostily Captcha: eine dünne Hülle um das Web Component <hostily-captcha>. SSR-sicher (SvelteKit). Die Komponente liefert nur das Token; das Secret gehört nie in den Browser – das Token prüft Ihr Server (z. B. mit @hostily/captcha).

npm install @hostily/captcha-svelte
<script>
  import { HostilyCaptcha } from "@hostily/captcha-svelte";
  let captcha;
  let token = "";
</script>

<form method="post" action="/kontakt">
  <HostilyCaptcha bind:this={captcha} siteKey="IHR_SITE_KEY" onVerify={(t) => (token = t)} onExpire={() => (token = "")} />
  <button>Senden</button>
</form>

Im Formular steht das Token im Feld hostily-captcha-token; onVerify bekommt es zusätzlich. Die Komponente ist in der Syntax geschrieben, die Svelte 4 und 5 gleichermaßen übersetzen (Rückrufe als Props); in Svelte 5 läuft sie im Legacy-Modus des Aufrufers unverändert, Ihre eigenen Komponenten dürfen Runes nutzen.

| Prop | Bedeutung | Vorgabe | |---|---|---| | siteKey | Site-Key des Projekts (Pflicht) | – | | api | Basisadresse des Dienstes | https://captcha.hostily.de/api/ | | modus | "sichtbar" (Haken) / "unsichtbar" / "halten" (Taste gedrückt halten) / "schieben" (Schieberegler). „Halten“ und „Schieben“ bieten die Alternative „Lieber per Klick bestätigen“. Nicht gesetzt: der Modus des Projekts im Kundenportal | nicht gesetzt (Portal) | | haltezeit | Millisekunden (800 bis 3000), nur für modus="halten" | 1500 | | id, aria-*, data-* | werden unverändert ans Element gereicht | – | | sprache | "de" / "en" | aus <html lang> | | theme | "hell" / "dunkel" | System | | feld | Name des Token-Feldes | hostily-captcha-token | | recaptchaKompatibel | zusätzlich g-recaptcha-response | false | | widgetUrl | Adresse des Widget-Skripts (selbst gehostet) | <api>/../widget/hostily-captcha.js | | klasse | CSS-Klasse am Element | – | | onVerify(token) | Token liegt vor | – | | onError(meldung, code) | Fehler; code: netz, gesperrt, abgelehnt, challenge, rechnen, verfahren, skript | – | | onExpire() | Token abgelaufen oder vom Widget zurückgesetzt (nicht nach eigenem reset()) | – |

Per bind:this: reset() (nach Absenden per Ajax; ein Token gilt nur einmal), loesen() (Promise mit dem Token), token(). Das Widget-Skript wird einmal je Seite geladen, erst im Browser (onMount). CSP: script-src und connect-src für captcha.hostily.de, worker-src blob:, script-src 'wasm-unsafe-eval'.

Geprüft (SvelteKit 2.70, Produktionsbuild mit adapter-node, Browsertest gegen den echten Dienst): Svelte 4.2 und Svelte 5.57. Beispielprojekt: beispiel/, Test: test/lauf.sh.

English

Svelte component (Svelte 4 and 5) for hostily Captcha: a thin wrapper around the <hostily-captcha> web component, SSR-safe (SvelteKit). It only delivers the token; verify it on your server with the secret. Usage as above. Props: siteKey (required), api, modus (sichtbar/unsichtbar/halten/schieben = checkbox/invisible/press-and-hold/slider; hold and slide offer a "confirm by click instead" button; unset = the mode of the project in the customer portal), haltezeit (ms, 800 to 3000, only for halten), sprache (de/en), theme (hell/dunkel = light/dark), feld, recaptchaKompatibel, widgetUrl, klasse (CSS class), callbacks onVerify(token), onError(message, code), onExpire() (not fired by your own reset()). Methods via bind:this: reset(), loesen(), token(). The script is loaded once per page, in the browser only. Tested: SvelteKit 2.70 production builds with Svelte 4.2 and 5.57, browser test against the live service.

MIT