@wexio/messenger-widget-angular 1.0.27 → 1.0.29
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/package.json +1 -1
- package/dist/LICENSE +0 -21
- package/dist/README.md +0 -175
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wexio/messenger-widget-angular",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.29",
|
|
4
4
|
"description": "Angular standalone component embed for the Wexio web messenger. Thin wrapper around the <wexio-widget> custom element — same WidgetShell runtime, same Shadow-DOM isolation.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
package/dist/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Wexio
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/dist/README.md
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
# Welcome to @wexio/messenger-widget-angular 👋
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@wexio/messenger-widget-angular)
|
|
4
|
-
[](./LICENSE)
|
|
5
|
-
[](https://learn.wexio.io/docs/web-widget)
|
|
6
|
-
|
|
7
|
-
Native Angular standalone component for the [Wexio](https://wexio.io) web messenger. Thin wrapper around the underlying `<wexio-widget>` custom element — same `WidgetShell` runtime as the script-injected iframe and the React component. Same chat, same visitor identity, same backend; the only difference is **where the Angular tree mounts**.
|
|
8
|
-
|
|
9
|
-
🏠 [Website](https://wexio.io)
|
|
10
|
-
📚 [Developer Docs](https://learn.wexio.io/docs/web-widget)
|
|
11
|
-
|
|
12
|
-
## 📂 Description
|
|
13
|
-
|
|
14
|
-
- [Installation](#installation)
|
|
15
|
-
- [Quick start](#quick-start)
|
|
16
|
-
- [Identifying users](#identifying-users)
|
|
17
|
-
- [Inputs](#inputs)
|
|
18
|
-
- [Outputs](#outputs)
|
|
19
|
-
- [Types](#types)
|
|
20
|
-
- [SSR (Angular Universal)](#ssr-angular-universal)
|
|
21
|
-
- [Browser support](#browser-support)
|
|
22
|
-
- [Author](#author)
|
|
23
|
-
- [License](#-license)
|
|
24
|
-
|
|
25
|
-
## Installation
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
yarn add @wexio/messenger-widget-angular
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
or
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
npm install @wexio/messenger-widget-angular
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
Peer dependencies: `@angular/core >= 16`, `@angular/common >= 16`. The widget uses the host's Angular runtime.
|
|
38
|
-
|
|
39
|
-
## Quick start
|
|
40
|
-
|
|
41
|
-
```ts
|
|
42
|
-
// app.component.ts
|
|
43
|
-
import { Component } from "@angular/core";
|
|
44
|
-
import { WexioWidgetComponent } from "@wexio/messenger-widget-angular";
|
|
45
|
-
|
|
46
|
-
@Component({
|
|
47
|
-
standalone: true,
|
|
48
|
-
imports: [WexioWidgetComponent],
|
|
49
|
-
selector: "app-root",
|
|
50
|
-
template: `
|
|
51
|
-
<main>
|
|
52
|
-
<!-- your app -->
|
|
53
|
-
<wexio-widget-ng publicKey="pk_live_..." />
|
|
54
|
-
</main>
|
|
55
|
-
`,
|
|
56
|
-
})
|
|
57
|
-
export class AppComponent {}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
That's it — the widget mounts a floating launcher, handles its own theme/locale/state, and the operator dashboard sees the visitor immediately.
|
|
61
|
-
|
|
62
|
-
> **Selector** — the component selector is `wexio-widget-ng` (suffixed to avoid clashing with the underlying `<wexio-widget>` custom element it renders).
|
|
63
|
-
|
|
64
|
-
## Identifying users
|
|
65
|
-
|
|
66
|
-
Pass a verified `user` input to log a known visitor in. Provide ONE proof — a Google FedCM `id_token`, a host-signed `jwt`, or the legacy `userId` + `userHash` HMAC pair:
|
|
67
|
-
|
|
68
|
-
```ts
|
|
69
|
-
import { Component } from "@angular/core";
|
|
70
|
-
import {
|
|
71
|
-
VisitorIdentity,
|
|
72
|
-
WexioWidgetComponent,
|
|
73
|
-
} from "@wexio/messenger-widget-angular";
|
|
74
|
-
|
|
75
|
-
@Component({
|
|
76
|
-
standalone: true,
|
|
77
|
-
imports: [WexioWidgetComponent],
|
|
78
|
-
selector: "app-root",
|
|
79
|
-
template: `<wexio-widget-ng publicKey="pk_live_..." [user]="user" />`,
|
|
80
|
-
})
|
|
81
|
-
export class AppComponent {
|
|
82
|
-
user: VisitorIdentity = {
|
|
83
|
-
jwt: serverSignedJwt, // host-signed identity token (recommended)
|
|
84
|
-
name: "Ada Lovelace",
|
|
85
|
-
email: "ada@example.com",
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
> **Reactive identity** — assign a new object (or `null`) to `user` to re-fire the handshake / log out. The component's `ngOnChanges` watches it.
|
|
91
|
-
|
|
92
|
-
## Inputs
|
|
93
|
-
|
|
94
|
-
| Input | Type | Description |
|
|
95
|
-
| -------------- | ----------------------------- | --------------------------------------------------------------------------------- |
|
|
96
|
-
| `publicKey` | `string` | Wexio integration public key (`pk_live_...`). Omit for demo mode. |
|
|
97
|
-
| `locale` | `string` | UI locale (BCP-47). Overrides the operator's `localeStrategy`. |
|
|
98
|
-
| `prefillName` | `string` | Unverified prechat prefill. |
|
|
99
|
-
| `prefillEmail` | `string` | Unverified prechat prefill. |
|
|
100
|
-
| `prefillPhone` | `string` | Unverified prechat prefill. |
|
|
101
|
-
| `user` | `VisitorIdentity \| null` | Known-user identity proof. Pass `null` to log out. |
|
|
102
|
-
|
|
103
|
-
## Outputs
|
|
104
|
-
|
|
105
|
-
| Output | Payload | When |
|
|
106
|
-
| --------- | -------------------------------------- | --------------------------------------------------- |
|
|
107
|
-
| `resize` | `{ width: number; height: number }` | Panel dimensions changed (open ↔ closed). |
|
|
108
|
-
| `close` | `void` | Visitor closed the panel. |
|
|
109
|
-
|
|
110
|
-
```ts
|
|
111
|
-
template: `
|
|
112
|
-
<wexio-widget-ng
|
|
113
|
-
publicKey="pk_live_..."
|
|
114
|
-
(resize)="onResize($event)"
|
|
115
|
-
(close)="onClose()"
|
|
116
|
-
/>
|
|
117
|
-
`;
|
|
118
|
-
|
|
119
|
-
// ...
|
|
120
|
-
onResize(size: { width: number; height: number }) {
|
|
121
|
-
console.log(size.width, size.height);
|
|
122
|
-
}
|
|
123
|
-
onClose() {
|
|
124
|
-
console.log("visitor closed the panel");
|
|
125
|
-
}
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
## Types
|
|
129
|
-
|
|
130
|
-
### VisitorIdentity
|
|
131
|
-
|
|
132
|
-
```ts
|
|
133
|
-
interface VisitorIdentity {
|
|
134
|
-
googleIdToken?: string; // Google FedCM id_token (preferred)
|
|
135
|
-
jwt?: string; // Host-signed JWT
|
|
136
|
-
userId?: string; // Legacy HMAC pair…
|
|
137
|
-
userHash?: string; // …(HMAC-SHA256(userId, integrationSecret))
|
|
138
|
-
name?: string;
|
|
139
|
-
email?: string;
|
|
140
|
-
phone?: string;
|
|
141
|
-
attributes?: Record<string, unknown>;
|
|
142
|
-
}
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
## SSR (Angular Universal)
|
|
146
|
-
|
|
147
|
-
The wrapper renders an empty `<wexio-widget>` element on the server. The actual widget initialises on first client-side mount (`ngAfterViewInit`). No special handling is needed for Angular Universal — the custom element runs only in the browser.
|
|
148
|
-
|
|
149
|
-
## Browser support
|
|
150
|
-
|
|
151
|
-
Modern evergreen browsers — anything that supports Shadow DOM and ES2020. Internet Explorer is not supported.
|
|
152
|
-
|
|
153
|
-
## Use with other frameworks
|
|
154
|
-
|
|
155
|
-
The underlying widget runtime is a Web Component, so it works in any modern framework:
|
|
156
|
-
|
|
157
|
-
- [`@wexio/messenger-widget-react`](https://www.npmjs.com/package/@wexio/messenger-widget-react) — React
|
|
158
|
-
- [`@wexio/messenger-widget-vue`](https://www.npmjs.com/package/@wexio/messenger-widget-vue) — Vue 3
|
|
159
|
-
- [`@wexio/messenger-widget-ember`](https://www.npmjs.com/package/@wexio/messenger-widget-ember) — Ember
|
|
160
|
-
|
|
161
|
-
## Author
|
|
162
|
-
|
|
163
|
-
👤 **Wexio** ([https://wexio.io](https://wexio.io))
|
|
164
|
-
|
|
165
|
-
## Show your support
|
|
166
|
-
|
|
167
|
-
Give a ⭐️ if this package helped you!
|
|
168
|
-
|
|
169
|
-
## 📝 License
|
|
170
|
-
|
|
171
|
-
This project is [MIT](./LICENSE) licensed.
|
|
172
|
-
|
|
173
|
-
---
|
|
174
|
-
|
|
175
|
-
_Created with ❤️ by [Wexio](https://wexio.io)_
|