@reechdesk/react 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 +71 -0
- package/dist/components/ChatWidget.d.ts +14 -0
- package/dist/components/HelpdeskProvider.d.ts +36 -0
- package/dist/components/KBSearch.d.ts +7 -0
- package/dist/components/TicketStatus.d.ts +6 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +766 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +760 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +30 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Reechdesk
|
|
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,71 @@
|
|
|
1
|
+
# @reechdesk/react
|
|
2
|
+
|
|
3
|
+
React SDK for Reechdesk — chat widget, ticket status checker, and knowledge base search.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @reechdesk/react
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @reechdesk/react
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Setup
|
|
14
|
+
|
|
15
|
+
Wrap your app with `HelpdeskProvider`:
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { HelpdeskProvider, ChatWidget } from '@reechdesk/react';
|
|
19
|
+
|
|
20
|
+
function App() {
|
|
21
|
+
return (
|
|
22
|
+
<HelpdeskProvider entityId="your-entity-id">
|
|
23
|
+
<YourApp />
|
|
24
|
+
<ChatWidget />
|
|
25
|
+
</HelpdeskProvider>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Components
|
|
31
|
+
|
|
32
|
+
### `<ChatWidget />`
|
|
33
|
+
|
|
34
|
+
Floating chat bubble with a full chat window.
|
|
35
|
+
|
|
36
|
+
| Prop | Type | Default | Description |
|
|
37
|
+
|------|------|---------|-------------|
|
|
38
|
+
| `position` | `'bottom-right' \| 'bottom-left'` | `'bottom-right'` | Position of the chat bubble |
|
|
39
|
+
| `primaryColor` | `string` | `'#f26522'` | Brand color |
|
|
40
|
+
| `greeting` | `string` | `'Hi! How can we help?'` | Welcome message |
|
|
41
|
+
| `poweredBy` | `boolean` | `true` | Show "Powered by Reechdesk" footer |
|
|
42
|
+
| `soundEnabled` | `boolean` | `true` | Play sound on new messages |
|
|
43
|
+
|
|
44
|
+
### `<TicketStatus />`
|
|
45
|
+
|
|
46
|
+
Let customers check their ticket status.
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
<TicketStatus ticketNumber="TKT-00123" />
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
| Prop | Type | Description |
|
|
53
|
+
|------|------|-------------|
|
|
54
|
+
| `ticketNumber` | `string` | Pre-fill ticket number |
|
|
55
|
+
|
|
56
|
+
### `<KBSearch />`
|
|
57
|
+
|
|
58
|
+
Embedded knowledge base search.
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
<KBSearch placeholder="Search help articles..." maxResults={5} />
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
| Prop | Type | Default | Description |
|
|
65
|
+
|------|------|---------|-------------|
|
|
66
|
+
| `placeholder` | `string` | `'Search help articles...'` | Input placeholder |
|
|
67
|
+
| `maxResults` | `number` | `5` | Max results to show |
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
MIT
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ChatWidgetProps {
|
|
3
|
+
position?: 'bottom-right' | 'bottom-left';
|
|
4
|
+
primaryColor?: string;
|
|
5
|
+
greeting?: string;
|
|
6
|
+
entityName?: string;
|
|
7
|
+
logoUrl?: string | null;
|
|
8
|
+
borderRadius?: number;
|
|
9
|
+
inputBorderRadius?: number;
|
|
10
|
+
poweredBy?: boolean;
|
|
11
|
+
soundEnabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function ChatWidget({ position, primaryColor, greeting, entityName, logoUrl, borderRadius, inputBorderRadius, poweredBy, soundEnabled, }: ChatWidgetProps): React.JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PusherJS from 'pusher-js';
|
|
3
|
+
export interface HelpdeskUser {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
email: string;
|
|
7
|
+
}
|
|
8
|
+
export interface EntityBranding {
|
|
9
|
+
entityName: string;
|
|
10
|
+
logoUrl: string | null;
|
|
11
|
+
primaryColor: string;
|
|
12
|
+
greeting: string;
|
|
13
|
+
position: 'bottom-right' | 'bottom-left';
|
|
14
|
+
borderRadius: number;
|
|
15
|
+
poweredBy: boolean;
|
|
16
|
+
soundEnabled: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface HelpdeskContextValue {
|
|
19
|
+
entityId: string;
|
|
20
|
+
apiUrl: string;
|
|
21
|
+
user?: HelpdeskUser;
|
|
22
|
+
sessionId: string | null;
|
|
23
|
+
setSessionId: (id: string | null) => void;
|
|
24
|
+
pusher: PusherJS | null;
|
|
25
|
+
branding: EntityBranding;
|
|
26
|
+
}
|
|
27
|
+
export declare function useHelpdesk(): HelpdeskContextValue;
|
|
28
|
+
interface HelpdeskProviderProps {
|
|
29
|
+
entityId: string;
|
|
30
|
+
apiUrl?: string;
|
|
31
|
+
user?: HelpdeskUser;
|
|
32
|
+
pusherKey?: string;
|
|
33
|
+
children: React.ReactNode;
|
|
34
|
+
}
|
|
35
|
+
export declare function HelpdeskProvider({ entityId, apiUrl, user, pusherKey, children, }: HelpdeskProviderProps): React.JSX.Element;
|
|
36
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { HelpdeskProvider, useHelpdesk } from './components/HelpdeskProvider';
|
|
2
|
+
export type { HelpdeskUser, HelpdeskContextValue, EntityBranding } from './components/HelpdeskProvider';
|
|
3
|
+
export { ChatWidget } from './components/ChatWidget';
|
|
4
|
+
export { TicketStatus } from './components/TicketStatus';
|
|
5
|
+
export { KBSearch } from './components/KBSearch';
|