@aperture-browser/session-element 0.0.0-nightly.98.95679814d178 → 1.0.0-beta.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/README.md CHANGED
@@ -1,29 +1,26 @@
1
1
  # @aperture-browser/session-element
2
2
 
3
- Custom elements that embed a live [Aperture](https://github.com/tarik02/aperture) browser session in any page, isolated in Shadow DOM.
3
+ `<aperture-session>`: one [Aperture](https://github.com/tarik02/aperture) session in any page, as a custom element with the workbench's tab strip, toolbar and menus in a shadow tree. It brings React with it and asks nothing of the page.
4
4
 
5
- - `<aperture-session>`: the session with its UI: tabs, toolbar and menus.
6
- - `<aperture-session-view>`: the session alone, with a JavaScript API for pages that build their own controls.
5
+ ```sh
6
+ npm install @aperture-browser/session-element@beta
7
+ ```
8
+
9
+ While Aperture is in beta its packages are under the dist-tag `beta`; a package has the version of the server it speaks to.
7
10
 
8
11
  ```html
9
- <script type="module" src="https://cdn.jsdelivr.net/npm/@aperture-browser/session-element/dist/aperture-session.js"></script>
12
+ <script type="module">
13
+ import "@aperture-browser/session-element";
14
+ </script>
10
15
 
11
16
  <aperture-session
12
- base-url="https://aperture.example"
13
- token="apv_…"
14
- style="display: block; height: 600px"
17
+ url="https://aperture.example.com/n/NODE/sessions/SESSION"
18
+ token="TICKET"
19
+ name="Ada"
20
+ theme="system"
21
+ hide="recordings files"
22
+ style="height: 100dvh"
15
23
  ></aperture-session>
16
24
  ```
17
25
 
18
- Documentation: https://aperture-browser-docs.pages.dev/docs/packages/session-element
19
-
20
- ## Backend relay
21
-
22
- Both custom elements accept a typed `access` property:
23
-
24
- ```js
25
- const element = document.querySelector("aperture-session-view");
26
- element.access = { kind: "relay", baseUrl: "/aperture", sessionId: "your-session-id" };
27
- ```
28
-
29
- The same-origin backend authenticates the app user; no Aperture token or role belongs in the page. The property takes precedence over `token`/`base-url` attributes. Set it to `null` to return to attribute-based configuration. The existing token attributes remain a convenience for direct share links. Use `snapshot.role` only after `snapshot.connection === "connected"`; the authorized role comes from Aperture.
26
+ `url` is the session's base and `token` a ticket your backend asked the control plane for. `hide` names the parts to leave out: `tabs navigation address-bar presence menus files recordings page-menu sound toaster`. From script, the `features` and `contributions` properties do the same and more, `session` is the session's client, and the `aperture-session` event tells when there is one.