@plucky-ai/chat-sdk 0.3.0 → 0.3.2
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 +20 -31
- package/dist/package.json +1 -1
- package/package.json +2 -4
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @plucky-ai/chat-sdk
|
|
2
2
|
|
|
3
|
-
A lightweight SDK for integrating Plucky
|
|
3
|
+
A lightweight SDK for integrating Plucky into your applications. Access the full docs [here](https://docs.plucky.ai).
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -14,36 +14,25 @@ pnpm add @plucky-ai/chat-sdk
|
|
|
14
14
|
|
|
15
15
|
## Usage
|
|
16
16
|
|
|
17
|
-
```
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
17
|
+
```javascript
|
|
18
|
+
import { Plucky, sendMessage } from '@plucky-ai/chat-sdk'
|
|
19
|
+
|
|
20
|
+
const APP_ID = 'Your app id'
|
|
21
|
+
const BASE_URL = 'https://widget.plucky.ai'
|
|
22
|
+
|
|
23
|
+
Plucky({
|
|
24
|
+
appId: APP_ID,
|
|
25
|
+
baseUrl: BASE_URL,
|
|
26
|
+
user: {
|
|
27
|
+
id: 'user-123',
|
|
28
|
+
name: 'John Doe',
|
|
29
|
+
email: 'john@example.com',
|
|
30
|
+
createdAt: '2024-01-15T00:00:00.000Z',
|
|
31
|
+
},
|
|
23
32
|
})
|
|
24
33
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
## API Reference
|
|
30
|
-
|
|
31
|
-
### `init(options: InitOptions)`
|
|
32
|
-
|
|
33
|
-
Initializes the Plucky Chat SDK with the provided options.
|
|
34
|
-
|
|
35
|
-
### `getAPI()`
|
|
36
|
-
|
|
37
|
-
Returns the current API instance, creating one if it doesn't exist.
|
|
38
|
-
|
|
39
|
-
## Types
|
|
40
|
-
|
|
41
|
-
```typescript
|
|
42
|
-
interface InitOptions {
|
|
43
|
-
// Configuration options for the SDK
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
interface PluckyAPI {
|
|
47
|
-
// API methods and properties
|
|
48
|
-
}
|
|
34
|
+
sendMessage({
|
|
35
|
+
content: 'Hello world!',
|
|
36
|
+
createChat: true,
|
|
37
|
+
})
|
|
49
38
|
```
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plucky-ai/chat-sdk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -12,13 +12,11 @@
|
|
|
12
12
|
"require": "./dist/index.cjs"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@plucky-ai/loader-types": "^0.2.1"
|
|
17
|
-
},
|
|
18
15
|
"devDependencies": {
|
|
19
16
|
"tsdown": "^0.15.12",
|
|
20
17
|
"tsx": "^4.20.6",
|
|
21
18
|
"typescript": "^5.9.3",
|
|
19
|
+
"@plucky-ai/loader-types": "^0.2.1",
|
|
22
20
|
"@plucky-ai/loader": "0.2.1"
|
|
23
21
|
},
|
|
24
22
|
"publishConfig": {
|