open-index/open-npm huggingface dataset:
npm package: @oddjs/passkeys
Description: ODD SDK Passkeys components.
Author: Hugo Dias
Latest version: 0.2.1

# odd-passkeys [![NPM Version](https://img.shields.io/npm/v/@oddjs/passkeys.svg)](https://www.npmjs.com/package/@oddjs/passkeys) [![License](https://img.shields.io/npm/l/@oddjs/passkeys.svg)](https://github.com/oddsdk/passkeys/blob/main/license) [![odd-passkeys](https://github.com/oddsdk/passkeys/actions/workflows/odd-passkeys.yml/badge.svg)](https://github.com/oddsdk/passkeys/actions/workflows/odd-passkeys.yml)

> ODD SDK passkeys components

## Install

```bash
pnpm install @oddjs/passkeys
```

## Usage

```js
import { createComponents } from '@oddjs/passkeys'
```

## Docs

Check <https://oddsdk.github.io/passkeys/modules/_oddjs_passkeys.html>
npm package: @oddjs/preact
Description: ODD SDK Preact hooks and context provider.
Author: Hugo Dias
Latest version: 0.3.0

# odd-preact [![NPM Version](https://img.shields.io/npm/v/@oddjs/preact.svg)](https://www.npmjs.com/package/@oddjs/preact) [![License](https://img.shields.io/npm/l/@oddjs/preact.svg)](https://github.com/oddsdk/passkeys/blob/main/license) [![odd-passkeys](https://github.com/oddsdk/passkeys/actions/workflows/odd-preact.yml/badge.svg)](https://github.com/oddsdk/passkeys/actions/workflows/odd-preact.yml)

> ODD SDK Preact hooks and context provider.

## Install

```bash
pnpm install @oddjs/preact
```

## Usage

```js
// app.jsx
import { OddContextProvider } from '@oddjs/preact'
/** @type {import('@oddjs/odd').Configuration} */
const config = {
  namespace: {
    creator: document.location.host,
    name: 'Passkey auth',
  },
}

export function App() {
  return (
    <>
      <OddContextProvider
        config={config}
        componentsFactory={OddPasskey.createComponents}
      >
        <main className="App">
          <Home path="/" />
        </main>
      </OddContextProvider>
    </>
  )
}

// home.jsx
import { useOddContext } from '@oddjs/preact'

export default function Home(props) {
  const { session, isLoading, login, logout, register } = useOddContext()
}

// home.jsx with preact-router
import { useOdd } from '@oddjs/preact/router'

export default function Home(props) {
  const { session, isLoading, login, logout, register } = useOdd({
    redirectTo: '/login',
  })
}
```

## Docs

Check <https://oddsdk.github.io/passkeys/modules/_oddjs_preact.html>