@ave-id/embed 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +26 -0
  2. package/package.json +13 -0
package/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # @ave-id/embed
2
+
3
+ Lightweight iframe embed for Ave sign-in with postMessage callbacks.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @ave-id/embed
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```js
14
+ import { mountAveEmbed } from "@ave-id/embed";
15
+
16
+ const { iframe } = mountAveEmbed({
17
+ container: document.getElementById("ave-embed"),
18
+ clientId: "YOUR_CLIENT_ID",
19
+ redirectUri: "https://yourapp.com/callback",
20
+ scope: "openid profile email",
21
+ onSuccess: ({ redirectUrl }) => {
22
+ window.location.href = redirectUrl;
23
+ },
24
+ onError: (payload) => console.error("Embed error", payload),
25
+ });
26
+ ```
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@ave-id/embed",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "main": "dist/embed.js",
6
+ "files": ["dist"],
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
10
+ "scripts": {
11
+ "build": "mkdir -p dist && cp src/embed.js dist/embed.js"
12
+ }
13
+ }