@nominalso/vibe-host 0.0.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/LICENSE ADDED
@@ -0,0 +1,10 @@
1
+ Copyright © 2026 Nominal. All rights reserved.
2
+
3
+ This software and its source code are proprietary and confidential.
4
+ The packages published from this repository are marked "UNLICENSED": no
5
+ license or right to use, copy, modify, distribute, or create derivative
6
+ works is granted except under a separate written agreement with Nominal.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
10
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # @nominalso/vibe-host
2
+
3
+ Host-side SDK for embedding **Nominal Vibe Apps**. Used by the Nominal app (nom-ui) to receive requests from an
4
+ embedded Vibe App over a typed `postMessage` protocol and dispatch them to Nominal APIs. The host ships a
5
+ **complete, type-checked handler map** covering every protocol operation — you only supply a `clientConfig`
6
+ pointing at the Nominal API, and the SDK wires up and dispatches all operations for you.
7
+
8
+ ## Install
9
+
10
+ ```sh
11
+ npm install @nominalso/vibe-host
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ ```tsx
17
+ import { VibeAppHost } from '@nominalso/vibe-host'
18
+
19
+ const host = new VibeAppHost({
20
+ trustedOrigins: ['https://my-vibe-app.lovable.app'],
21
+ appBasePath: `/${tenant}/${subsidiary}/apps/${slug}`,
22
+ getContext: () => ({ tenant, subsidiaryId, subsidiaries, user, lastClosedPeriodSlug }),
23
+ // Points the built-in handler map at the Nominal API (e.g. nom-ui's proxy route).
24
+ // The SDK provides handlers for every protocol operation out of the box.
25
+ clientConfig: { baseUrl: '/api/proxy', stripApiPrefix: true },
26
+ })
27
+
28
+ // Start listening before the iframe loads, then push context on its `load` event.
29
+ const unmount = host.mount()
30
+ // host.pushContextTo(iframe.contentWindow)
31
+ ```
32
+
33
+ The iframe side is [`@nominalso/vibe-bridge`](https://www.npmjs.com/package/@nominalso/vibe-bridge). See the
34
+ [repository](https://github.com/nominalso/vibe-apps-sdk#readme) for the full protocol, architecture, and the
35
+ SSR / iframe-mounting notes.
36
+
37
+ ## License
38
+
39
+ UNLICENSED — proprietary. © Nominal. All rights reserved.