open-index/open-npm huggingface dataset:
npm package: @swr-login/core
Description: Core logic for swr-login: state machine, token management, plugin system, event emitter
Latest version: 0.6.0

# @swr-login/core

> Core logic for swr-login: state machine, token management, plugin system, event emitter.

[![npm](https://img.shields.io/npm/v/@swr-login/core?color=blue)](https://www.npmjs.com/package/@swr-login/core)
[![bundle size](https://img.shields.io/bundlephobia/minzip/@swr-login/core)](https://bundlephobia.com/package/@swr-login/core)
[![license](https://img.shields.io/github/license/swr-login/swr-login)](https://github.com/tobytovi/swr-login/blob/main/LICENSE)

## Install

```bash
npm install @swr-login/core
```

## Features

- ⚡ **SWR-Powered** — Stale-while-revalidate strategy for instant auth state
- 🔌 **Plugin Architecture** — Every login channel is an independent package
- 🔄 **Cross-tab Sync** — BroadcastChannel-based login/logout sync
- 🪶 **Tiny** — <3KB gzipped
- 📦 **100% TypeScript** — Full generics and JSDoc

## Usage

```ts
import { createAuthClient } from '@swr-login/core';

const client = createAuthClient({
  adapter: myAdapter,
  plugins: [myPlugin],
  fetchUser: async (token) => {
    const res = await fetch('/api/me', {
      headers: { Authorization: `Bearer ${token}` },
    });
    return res.json();
  },
});
```

## Custom Plugin

```ts
import type { SWRLoginPlugin } from '@swr-login/core';

const MyPlugin: SWRLoginPlugin<{ token: string }> = {
  name: 'my-sso',
  type: 'oauth',
  async login({ token }, ctx) {
    const res = await fetch('/api/sso/verify', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ token }),
    });
    const data = await res.json();
    ctx.setTokens({ accessToken: data.accessToken, expiresAt: data.expiresAt });
    return data;
  },
};
```

## Part of swr-login

This is the framework-agnostic core of the [swr-login](https://github.com/tobytovi/swr-login) project. For React bindings, see [`@swr-login/react`](https://www.npmjs.com/package/@swr-login/react).

## License

[MIT](https://github.com/tobytovi/swr-login/blob/main/LICENSE)
npm package: @swr-login/plugin-oauth-google
Description: Google OAuth 2.0 login plugin for swr-login (supports Popup & Redirect with PKCE)
Latest version: 0.2.4

# @swr-login/plugin-oauth-google

> Google OAuth 2.0 login plugin for swr-login (supports Popup & Redirect with PKCE).

[![npm](https://img.shields.io/npm/v/@swr-login/plugin-oauth-google?color=blue)](https://www.npmjs.com/package/@swr-login/plugin-oauth-google)
[![license](https://img.shields.io/github/license/swr-login/swr-login)](https://github.com/tobytovi/swr-login/blob/main/LICENSE)

## Install

```bash
npm install @swr-login/plugin-oauth-google
```

## Usage

```ts
import { GoogleOAuthPlugin } from '@swr-login/plugin-oauth-google';

const plugin = GoogleOAuthPlugin({
  clientId: 'your-google-client-id',
  redirectUri: 'https://yourapp.com/callback/google',
  // 'popup' (default) | 'redirect'
  mode: 'popup',
});
```

Then use the `useLogin` hook:

```tsx
const { login, isLoading } = useLogin('google');

<button onClick={() => login()}>Sign in with Google</button>
```

## Features

- 🔒 PKCE (Proof Key for Code Exchange) enforced
- 🔒 CSRF state parameter validation
- 🪟 Popup and redirect modes
- ⚡ Zero page refresh on login

## Part of swr-login

See the full project at [github.com/tobytovi/swr-login](https://github.com/tobytovi/swr-login).

## License

[MIT](https://github.com/tobytovi/swr-login/blob/main/LICENSE)
npm package: @swr-login/plugin-oauth-wechat
Description: WeChat OAuth login plugin for swr-login (QR code scan & H5 web authorization)
Latest version: 0.2.4

# @swr-login/plugin-oauth-wechat

> WeChat OAuth login plugin for swr-login (QR code scan & H5 web authorization).

[![npm](https://img.shields.io/npm/v/@swr-login/plugin-oauth-wechat?color=blue)](https://www.npmjs.com/package/@swr-login/plugin-oauth-wechat)
[![license](https://img.shields.io/github/license/swr-login/swr-login)](https://github.com/tobytovi/swr-login/blob/main/LICENSE)

## Install

```bash
npm install @swr-login/plugin-oauth-wechat
```

## Usage

```ts
import { WeChatOAuthPlugin } from '@swr-login/plugin-oauth-wechat';

const plugin = WeChatOAuthPlugin({
  appId: 'your-wechat-app-id',
  redirectUri: 'https://yourapp.com/callback/wechat',
  // 'qrcode' (default) | 'h5'
  mode: 'qrcode',
});
```

Then use the `useLogin` hook:

```tsx
const { login, isLoading } = useLogin('wechat');

<button onClick={() => login()}>微信登录</button>
```

## Features

- 📱 QR code scan login (PC web)
- 🌐 H5 web authorization (mobile browser)
- 🔒 CSRF state parameter validation
- ⚡ Zero page refresh on login

## Part of swr-login

See the full project at [github.com/tobytovi/swr-login](https://github.com/tobytovi/swr-login).

## License

[MIT](https://github.com/tobytovi/swr-login/blob/main/LICENSE)
npm package: @swr-login/plugin-passkey
Description: WebAuthn/Passkey login plugin for swr-login (biometric & security key authentication)
Latest version: 0.2.4

# @swr-login/plugin-passkey

> WebAuthn/Passkey login plugin for swr-login (biometric & security key authentication).

[![npm](https://img.shields.io/npm/v/@swr-login/plugin-passkey?color=blue)](https://www.npmjs.com/package/@swr-login/plugin-passkey)
[![license](https://img.shields.io/github/license/swr-login/swr-login)](https://github.com/tobytovi/swr-login/blob/main/LICENSE)

## Install

```bash
npm install @swr-login/plugin-passkey
```

## Usage

```ts
import { PasskeyPlugin } from '@swr-login/plugin-passkey';

const plugin = PasskeyPlugin({
  rpId: 'yourapp.com',
  rpName: 'Your App',
});
```

Then use the `useLogin` hook:

```tsx
const { login, isLoading } = useLogin('passkey');

<button onClick={() => login()}>Sign in with Passkey</button>
```

## Features

- 🔐 WebAuthn / FIDO2 standard
- 👆 Biometric authentication (Face ID, Touch ID, fingerprint)
- 🔑 Security key support (YubiKey, etc.)
- 🔒 Phishing-resistant — no passwords to steal
- ⚡ Zero page refresh on login

## Part of swr-login

See the full project at [github.com/tobytovi/swr-login](https://github.com/tobytovi/swr-login).

## License

[MIT](https://github.com/tobytovi/swr-login/blob/main/LICENSE)
npm package: @swr-login/plugin-password
Description: Username/password login plugin for swr-login
Latest version: 0.2.4

# @swr-login/plugin-password

> Username/password login plugin for swr-login.

[![npm](https://img.shields.io/npm/v/@swr-login/plugin-password?color=blue)](https://www.npmjs.com/package/@swr-login/plugin-password)
[![license](https://img.shields.io/github/license/swr-login/swr-login)](https://github.com/tobytovi/swr-login/blob/main/LICENSE)

## Install

```bash
npm install @swr-login/plugin-password
```

## Usage

```ts
import { PasswordPlugin } from '@swr-login/plugin-password';

const plugin = PasswordPlugin({
  loginUrl: '/api/login',
});
```

Then use the `useLogin` hook:

```tsx
const { login, isLoading, error } = useLogin('password');

await login({ username: 'alice', password: 'secret' });
```

## Options

| Option | Type | Required | Description |
|--------|------|----------|-------------|
| `loginUrl` | `string` | ✅ | Your backend login endpoint |

## Part of swr-login

See the full project at [github.com/tobytovi/swr-login](https://github.com/tobytovi/swr-login).

## License

[MIT](https://github.com/tobytovi/swr-login/blob/main/LICENSE)
npm package: @swrlab/swr-prettier-config
Description: SWR Audio Lab Prettier config
Author: SWR Audio Lab
Latest version: 0.3.0
Deprecated: Please migrate to @swrlab/style-guide

# SWR Prettier config

- [SWR Prettier config](#swr-prettier-config)
  - [Installation](#installation)
  - [Editor Config](#editor-config)

## Installation

Step 1: Install [npm package](https://www.npmjs.com/package/@swrlab/swr-prettier-config)

```shell
npm install @swrlab/swr-prettier-config --save-dev
```

or

```shell
yarn add @swrlab/swr-prettier-config -D
```

Step 2: Include in `package.json`:

```json
{
  "prettier": "@swrlab/swr-prettier-config"
}
```

Or create a `.prettierrc.json` file with a link:

```json
"@swrlab/swr-prettier-config"
```

## Editor Config

This repository also contains a [`.editorconfig`](./.editorconfig) file. Consider this version as the main and copy it to other repositories where needed. This should ensure that the same copy is used everywhere.
npm package: @swrve/icon-fonts
Description: Swrve Icon Fonts
Latest version: 0.0.5

# Font Icon Generator

### Why ?

This is a temporary (and very basic) solution to generate our own font icon. The script is using [webfonts-generator](https://github.com/sunflowerdeath/webfonts-generator), it takes all the SVG's file in the `svg` folder and generate font files alongside a CSS file.

* .css
* .eot
* .svg
* .ttf
* .woff
* .woff2

The goal is to use webfonts-generator as a webpack plugin, so we can automate the building of the font icon easily.

_Note from MAP : I didn't manage to implement [webfonts-loader](https://github.com/jeerbl/webfonts-loader) with our current webpack config because the plugin `extract-text-webpack-plugin` hasn't been updated for Webpack 4.
There are workaround and other solution, but it need some times that I didn't have at that time to investigate more._

#### How to use

Add any svg icons in the src folder and run the command :

`node icon-font.js`
npm package: @swrve/swrve-react-scripts
Description: Configuration and scripts for Create React App.
Latest version: 2.1.3-4

# react-scripts

This package includes scripts and configuration used by [Create React App](https://github.com/facebookincubator/create-react-app).<br>
Please refer to its documentation:

* [Getting Started](https://github.com/facebookincubator/create-react-app/blob/master/README.md#getting-started) – How to create a new app.
* [User Guide](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md) – How to develop apps bootstrapped with Create React App.
npm package: @sws2apps/github-gcloud-cli
Description: CLI to setup Workload Identity Federation to Google Cloud for GitHub Actions
Author: Scheduling Workbox System
Latest version: 1.28.0

# GitHub GCloud CLI

A quickest way to setup the keyless authentication to Google Cloud from GitHub Action. We internally use the `gcloud` CLI to make this setup much easier. The detailed steps which our CLI is handling are found on this page: [Setting up Workload Identity Federation](https://github.com/google-github-actions/auth#setting-up-workload-identity-federation).

## Usage

Run the CLI by typing the following in the terminal:

```bash
npx @sws2apps/github-gcloud-cli setup
```
![img1](https://user-images.githubusercontent.com/26148770/192100883-5edd547d-22f5-4bc8-9324-c3266da44c0d.png)

A browser window will now open, and asks you to authenticate to the Google Cloud SDK. Complete the authentication in that window, and the CLI window will use the authentication token it gets:

![img2](https://user-images.githubusercontent.com/26148770/192100980-6ed6efe9-811b-480b-9996-15e8a657cd80.png)

Provide the `PROJECT_ID` and the service account name to be created (if not provided, `github-service-account` will be used):

![img3](https://user-images.githubusercontent.com/26148770/192101000-38bc61d3-e5ba-401b-8d60-f44022825e42.png)

A set of commands will be executed in the terminal to complete the Workload Identity Federation setup:

![img5](https://user-images.githubusercontent.com/26148770/192101270-7c184a50-5fe6-4fc7-9146-a21bc5690c3e.png)

Finally, add the two secrets generated at the end to corresponding GitHub repository:

![img6](https://user-images.githubusercontent.com/26148770/192101372-c4380056-dd0b-4924-9139-db715d00f415.png)

## Note

**DO NOT FORGET** to add the necessary permissions to the service account created in the Google Cloud Console.
npm package: @sws2apps/vite-plugin-package-version
Description: A Vite plugin to load package version into environment variables
Author: Scheduling Workbox System
Latest version: 1.4.0
Deprecated: This package is no longer needed since the original package from vite-plugin-package-version now supports ESM.

# Vite Plugin to Display Package Version

DISCLAIMER: As the original package from [smnhgn/vite-plugin-typescript-starter](https://github.com/smnhgn/vite-plugin-package-version) now supports ESM, we will be soon deprecating this package.

Load package version of your package.json into your [vite](https://github.com/vitejs/vite) environment.

Will inject `import.meta.env.PACKAGE_VERSION` with the version specified in your package.json.

## Installation

```
npm i @sws2apps/vite-plugin-package-version
```

## Usage

```js
// vite.config.js
import { defineConfig } from 'vite';
import { loadVersion } from '@sws2apps/vite-plugin-package-version';

export default defineConfig({
  plugins: [loadVersion()],
});
```

## Note

This repo is taken from [vite-plugin-package-version](https://github.com/smnhgn/vite-plugin-package-version) by Simon Haugen with only some minor edits. Thanks to Simon for the original repo.