open-index/open-npm huggingface dataset:
npm package: @prestashopcorp/vue-domain-name
Description: Prestashop smb_edition domain name vue application
Author: PrestaShop
Latest version: 0.0.6

# Vue 3 + TypeScript + Vite

This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.

## Recommended IDE Setup

- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar)

## Type Support For `.vue` Imports in TS

Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's Take Over mode by following these steps:

1. Run `Extensions: Show Built-in Extensions` from VS Code's command palette, look for `TypeScript and JavaScript Language Features`, then right click and select `Disable (Workspace)`. By default, Take Over mode will enable itself if the default TypeScript extension is disabled.
2. Reload the VS Code window by running `Developer: Reload Window` from the command palette.

You can learn more about Take Over mode [here](https://github.com/johnsoncodehk/volar/discussions/471).
npm package: @prestige-app-cloud/widget
Description: Drop-in 'Login with Prestige Cloud' button widget with popup-based OAuth 2.0 PKCE flow
Author: Prestige Cloud
Latest version: 0.2.0

# @prestige-cloud/widget

Drop-in "Login with Prestige Cloud" button widget.

Renders a styled login button and handles the full OAuth 2.0 PKCE flow in a
popup window, so the host page's state is never lost during authentication.

## Installation

```bash
npm install @prestige-cloud/widget
```

## Usage

```typescript
import { PrestigeWidget } from "@prestige-cloud/widget";

PrestigeWidget.init({
  clientId: "your-client-id",
  scopes: ["profile", "connections:proxy"],
  containerId: "login-container",
  onConnect: (tokens) => console.log("Connected!", tokens),
  onError: (error) => console.error(error),
});
```

## How It Works

1. The widget renders a styled button into the target container (or `document.body`).
2. When clicked, a popup opens to the Prestige Cloud consent screen.
3. After the user authorizes, the popup posts the authorization code back via `postMessage`.
4. The widget exchanges the code for tokens using the SDK and calls your `onConnect` callback.

The popup-based approach avoids full-page redirects and keeps the host site's
state intact during authentication.

## Configuration

```typescript
interface WidgetConfig {
  /** OAuth client ID issued by Prestige Cloud. */
  clientId: string;
  /** OAuth scopes to request (e.g. "profile", "vault:standard_api"). */
  scopes: string[];
  /** Base URL of the Prestige Cloud instance. Defaults to the SDK default. */
  baseUrl?: string;
  /** DOM element ID to render the login button into. Falls back to document.body. */
  containerId?: string;
  /** Custom button label. Defaults to "Login with Prestige Cloud". */
  buttonText?: string;
  /** Called with the token set after a successful OAuth exchange. */
  onConnect?: (tokens: TokenSet) => void;
  /** Called when any error occurs during the OAuth flow. */
  onError?: (error: Error) => void;
}
```

## API

- `PrestigeWidget.init(config)` — Render the button and start listening for callbacks. Returns a widget instance.
- `widget.destroy()` — Remove the widget and close any open popup.

## Callback Page

The widget expects a page at `/prestige-callback` on your origin that posts the
authorization code back to the opener window. If you use `@prestige-cloud/react`,
the `<PrestigeCallback />` component handles this automatically.

## License

MIT