@voxket-ai/events-sdk 1.0.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.
- package/LICENSE +21 -0
- package/README.md +108 -0
- package/dist/api/ApiClient.d.ts +26 -0
- package/dist/components/AttendeePortal.d.ts +13 -0
- package/dist/components/DynamicForm.d.ts +2 -0
- package/dist/components/EventWidgetReact.d.ts +7 -0
- package/dist/components/ShadowWrapper.d.ts +6 -0
- package/dist/events-sdk.js +23360 -0
- package/dist/events-sdk.umd.cjs +250 -0
- package/dist/favicon.svg +1 -0
- package/dist/icons.svg +24 -0
- package/dist/index.d.ts +16 -0
- package/dist/types.d.ts +14 -0
- package/dist/utils/Logger.d.ts +7 -0
- package/dist/utils/Storage.d.ts +11 -0
- package/package.json +74 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Shashank Sanket
|
|
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/README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# @voxket-ai/events-sdk
|
|
2
|
+
|
|
3
|
+
> Embeddable event registration and ticketing widget SDK for Voxket.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Multiple Display Modes**: Popup modal, inline embedded widget, or fullscreen mode.
|
|
8
|
+
- **Shadow DOM Isolation**: Zero CSS conflicts with the host website styles.
|
|
9
|
+
- **Draft Auto-save & Recovery**: Automatically saves user progress and restores previous form entries via `xref_id` or email.
|
|
10
|
+
- **Attendee Portal**: Built-in login, verification code generation/reset, profile editing, and add-on purchasing.
|
|
11
|
+
- **Payment Handling**: External checkout in a dedicated tab with instant status updates.
|
|
12
|
+
- **Framework Agnostic**: Usable via vanilla JavaScript or directly as a React component.
|
|
13
|
+
- **TypeScript Support**: Full type definitions included out of the box.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install @voxket-ai/events-sdk
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Or via Yarn / pnpm:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
yarn add @voxket-ai/events-sdk
|
|
27
|
+
# or
|
|
28
|
+
pnpm add @voxket-ai/events-sdk
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Quick Start
|
|
34
|
+
|
|
35
|
+
### 1. Vanilla JavaScript / HTML
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
<div id="voxket-widget"></div>
|
|
39
|
+
|
|
40
|
+
<script type="module">
|
|
41
|
+
import { EventWidgetClient } from '@voxket-ai/events-sdk';
|
|
42
|
+
|
|
43
|
+
const widget = new EventWidgetClient({
|
|
44
|
+
eventSlug: 'your-event-slug',
|
|
45
|
+
baseUrl: 'https://api.voxket.com',
|
|
46
|
+
displayMode: 'popup', // 'popup' | 'widget' | 'fullscreen'
|
|
47
|
+
theme: {
|
|
48
|
+
mode: 'custom',
|
|
49
|
+
primaryColor: '#6366f1'
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
widget.mount('voxket-widget');
|
|
54
|
+
</script>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 2. React Applications
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import React from 'react';
|
|
61
|
+
import { EventWidget } from '@voxket-ai/events-sdk';
|
|
62
|
+
|
|
63
|
+
export function EventPage() {
|
|
64
|
+
return (
|
|
65
|
+
<EventWidget
|
|
66
|
+
config={{
|
|
67
|
+
eventSlug: 'your-event-slug',
|
|
68
|
+
baseUrl: 'https://api.voxket.com',
|
|
69
|
+
displayMode: 'widget',
|
|
70
|
+
theme: {
|
|
71
|
+
primaryColor: '#2563eb'
|
|
72
|
+
}
|
|
73
|
+
}}
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Configuration Options
|
|
82
|
+
|
|
83
|
+
| Option | Type | Default | Description |
|
|
84
|
+
| :--- | :--- | :--- | :--- |
|
|
85
|
+
| `eventSlug` | `string` | *(required)* | The unique identifier/slug of your Voxket event. |
|
|
86
|
+
| `baseUrl` | `string` | *(required)* | API base URL for Voxket backend endpoints. |
|
|
87
|
+
| `displayMode` | `'popup' \| 'widget' \| 'fullscreen'` | `'widget'` | Layout display mode for the widget. |
|
|
88
|
+
| `width` | `string` | `undefined` | Custom width (e.g. `'480px'`, `'100%'`). |
|
|
89
|
+
| `height` | `string` | `undefined` | Custom height (e.g. `'600px'`). |
|
|
90
|
+
| `theme.mode` | `'blue' \| 'white' \| 'custom'` | `'blue'` | Preset or custom theme mode. |
|
|
91
|
+
| `theme.primaryColor` | `string` | `undefined` | Custom hex or HSL brand color. |
|
|
92
|
+
| `debug` | `boolean` | `false` | Enable console logging for development. |
|
|
93
|
+
| `onEvent` | `(eventName: string, payload: any) => void` | `undefined` | Callback for widget lifecycle and telemetry events. |
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Client Methods (`EventWidgetClient`)
|
|
98
|
+
|
|
99
|
+
- **`mount(container: HTMLElement | string)`**: Mounts the widget into a DOM container element or ID.
|
|
100
|
+
- **`updateConfig(newConfig: Partial<WidgetConfig>)`**: Updates specific configuration values dynamically without remounting.
|
|
101
|
+
- **`setConfig(newConfig: WidgetConfig)`**: Replaces the full widget configuration.
|
|
102
|
+
- **`unmount()`**: Cleanly destroys the widget and cleans up event listeners and DOM roots.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## License
|
|
107
|
+
|
|
108
|
+
[MIT](LICENSE) © 2025 Shashank Sanket
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Logger } from '../utils/Logger';
|
|
2
|
+
export declare class ApiClient {
|
|
3
|
+
private baseUrl;
|
|
4
|
+
private slug;
|
|
5
|
+
private logger;
|
|
6
|
+
constructor(baseUrl: string, slug: string, logger: Logger);
|
|
7
|
+
private fetchApi;
|
|
8
|
+
getFormSchema(): Promise<any>;
|
|
9
|
+
submitRegistration(payload: any): Promise<any>;
|
|
10
|
+
trackProgress(payload: any): Promise<any>;
|
|
11
|
+
getDraft(xrefId: string): Promise<any>;
|
|
12
|
+
getDraftByEmail(email: string): Promise<any>;
|
|
13
|
+
portalLogin(payload: {
|
|
14
|
+
identifier: string;
|
|
15
|
+
password: string;
|
|
16
|
+
}): Promise<any>;
|
|
17
|
+
portalRequestPasswordReset(identifier: string): Promise<any>;
|
|
18
|
+
portalConfirmPasswordReset(payload: {
|
|
19
|
+
identifier: string;
|
|
20
|
+
code: string;
|
|
21
|
+
new_password: string;
|
|
22
|
+
}): Promise<any>;
|
|
23
|
+
portalGetProfile(token: string): Promise<any>;
|
|
24
|
+
portalUploadFile(token: string, file: File): Promise<any>;
|
|
25
|
+
portalUpdateProfile(token: string, payload: any): Promise<any>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ApiClient } from '../api/ApiClient';
|
|
3
|
+
import { StorageHelper } from '../utils/Storage';
|
|
4
|
+
import { Logger } from '../utils/Logger';
|
|
5
|
+
interface AttendeePortalProps {
|
|
6
|
+
apiClient: ApiClient;
|
|
7
|
+
storage: StorageHelper;
|
|
8
|
+
logger: Logger;
|
|
9
|
+
primaryColor: string;
|
|
10
|
+
onEvent?: (eventName: string, payload: any) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const AttendeePortal: React.FC<AttendeePortalProps>;
|
|
13
|
+
export {};
|