open-index/open-npm huggingface dataset:
npm package: @movsm/v1-consortium-web-pkg
Description: Everything you need to build a Svelte library, powered by [`sv`](https://npmjs.com/package/sv).
Latest version: 0.0.9

# Svelte library

Everything you need to build a Svelte library, powered by [`sv`](https://npmjs.com/package/sv).

Read more about creating a library [in the docs](https://svelte.dev/docs/kit/packaging).

## Creating a project

If you're seeing this, you've probably already done this step. Congrats!

```sh
# create a new project in the current directory
npx sv create

# create a new project in my-app
npx sv create my-app
```

## Developing

Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:

```sh
npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open
```

Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.

## Building

To build your library:

```sh
npm pack
```

To create a production version of your showcase app:

```sh
npm run build
```

You can preview the production build with `npm run preview`.

> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.

## Publishing

Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).

To publish your library to [npm](https://www.npmjs.com):

```sh
npm publish
```
npm package: @movvjs/svelte-turnstile
Description: Cloudflare Turnstile 캡차를 위한 Svelte 컴포넌트 모듈입니다.
Latest version: 0.0.3

# @movvjs/svelte-turnstile

Cloudflare Turnstile 캡차를 위한 Svelte 컴포넌트 모듈입니다.

## 설치

```bash
yarn add @movvjs/svelte-turnstile
# 또는
npm install @movvjs/svelte-turnstile
```

## 사전 준비

HTML에 Cloudflare Turnstile 스크립트를 추가합니다.

```html
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
```

## 사용법

```svelte
<script>
  import { Turnstile } from '@movvjs/svelte-turnstile'

  async function verify(token) {
    const res = await fetch('/api/verify', {
      method: 'POST',
      body: JSON.stringify({ token })
    })
    if (!res.ok) throw new Error('검증 실패')
  }
</script>

<Turnstile
  sitekey="YOUR_SITE_KEY"
  className="turnstile-widget"
  theme="light"
  language="ko"
  {verify}
  on:authenticated={() => console.log('인증 성공')}
  on:error={(e) => console.error('인증 실패', e.detail)}
/>
```

## Props

| 이름 | 타입 | 필수 | 기본값 | 설명 |
|---|---|---|---|---|
| `sitekey` | `string` | O | - | Cloudflare Turnstile 사이트 키 |
| `className` | `string` | O | - | 위젯 컨테이너에 적용할 CSS 클래스 |
| `theme` | `'light' \| 'dark' \| 'auto'` | - | `'light'` | 위젯 테마 |
| `language` | `string` | - | 자동 감지 | 위젯 언어 (예: `'ko'`, `'en'`, `'ja'`) |
| `verify` | `(token: string) => Promise<void>` | O | - | 토큰 서버 검증 함수. reject 시 error 이벤트 발생 |

## 이벤트

| 이름 | 타입 | 설명 |
|---|---|---|
| `authenticated` | `void` | 캡차 인증 및 서버 검증 성공 시 |
| `error` | `string` | 캡차 인증 실패 또는 서버 검증 실패 시 |

## 타입

```ts
import type { TurnstileOptions, TurnstileInstance } from '@movvjs/svelte-turnstile'
```

## 요구사항

- Svelte 4 또는 5
- Node.js 18+