@skillyo/embed 0.2.0 → 0.2.1

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.1
4
+
5
+ The README only: how to get a website key (any account, from the skill's Embed on a website, On your credits), how sites are matched, and what changing `inputs` does. No code changes.
6
+
3
7
  ## 0.2.0
4
8
 
5
9
  The `next-step:clicked` event and the `onNextStepClick` prop: the visitor clicked the call to action set on the skill, after a result, with the run's id and the address it opens. Nothing else changes.
package/README.md CHANGED
@@ -20,7 +20,17 @@ export function PricingHelp() {
20
20
  }
21
21
  ```
22
22
 
23
- You need a **website key** from Skillyo (Settings › API keys › Create key › Website key) with the skill ticked and your sites listed: your domain and any preview address. Website keys are by invitation for now: email hello@skillyo.ai to ask for one.
23
+ You need a **website key** from Skillyo. Any Skillyo account can make one:
24
+
25
+ 1. Open the skill in Skillyo and choose **⋯ › Embed on a website**.
26
+ 2. Choose **On your credits**. (A **Free** embed has no key: it is a link to the skill page to put in a frame, and this package can't use it.)
27
+ 3. Under **Where is it going?** choose **React or Next.js**, give your app's address, and press **Get the code**. The code has your key in it.
28
+
29
+ Afterwards the key's settings are under **Settings › Embedded skills**. Add every address the skill will load on to its **Sites**:
30
+
31
+ - `acme.com` covers `www.acme.com` too.
32
+ - A local address needs its scheme and port, as you open it: `http://localhost:3000`. A plain `localhost` is read as `https://localhost`.
33
+ - `*.acme.com` covers one level below `acme.com`. A wildcard on a shared host such as `*.vercel.app` lets every site there load your skill, so for previews add the exact preview address instead.
24
34
 
25
35
  How the skill looks and opens - in the page, a button, a slide-over or a floating button, with your brand - is set on the key in Skillyo. Change it there and your app picks it up on the next page load, with no new release.
26
36
 
@@ -52,6 +62,8 @@ A **secret key** (`sko_live_…`) is different: it acts as you, and belongs only
52
62
  />
53
63
  ```
54
64
 
65
+ **About `inputs`.** The keys are the skill's input ids, not the labels on its form. The visitor sees the values and can change them before running. When `inputs` changes, the skill is drawn again with the new values, which clears anything the visitor has typed into its form, so pass values once they are settled (for example when your own form is submitted), not on every keystroke. A field the key itself prefills in Skillyo takes the key's value and is hidden.
66
+
55
67
  Several skills on one site? Set the key once:
56
68
 
57
69
  ```tsx
@@ -76,7 +88,7 @@ const skill = useRef<SkillyoSkillHandle>(null);
76
88
  |---|---|---|
77
89
  | `publicKey` | `string` | The website key. Optional inside `SkillyoProvider` |
78
90
  | `skill` | `string` | Required. The skill's name as it appears in its address |
79
- | `inputs` | `Record<string, string \| number \| boolean>` | Fields to fill in, by input id. Visible and editable by the visitor |
91
+ | `inputs` | `Record<string, string \| number \| boolean>` | Fields to fill in, by input id. Visible and editable by the visitor. See below |
80
92
  | `autoHeight` | `boolean` | In the page only. Default `true`: grows to fit, never below the key's height |
81
93
  | `className`, `style` | | On the element the skill mounts into |
82
94
  | `onReady` | `() => void` | The skill is on screen |
@@ -88,6 +100,8 @@ const skill = useRef<SkillyoSkillHandle>(null);
88
100
 
89
101
  **Next.js:** the component is a client component and can be used from a server component. Nothing loads during server rendering.
90
102
 
103
+ **TanStack Start and Lovable:** the same. On the server it renders an empty `div`, and the skill loads in the browser, so it works in Lovable's TanStack Start projects and in its older Vite ones.
104
+
91
105
  ## Any other framework
92
106
 
93
107
  ```js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skillyo/embed",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Put a Skillyo skill in your web app: a React component, or mount() for any framework.",
5
5
  "license": "MIT",
6
6
  "author": "Skillyo",