@amigo-ai/sdk 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Amigo
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,102 @@
1
+ # Amigo TypeScript SDK
2
+
3
+ [![Tests](https://github.com/amigo-ai/amigo-typescript-sdk/actions/workflows/test.yml/badge.svg)](https://github.com/amigo-ai/amigo-typescript-sdk/actions/workflows/test.yml)
4
+ [![codecov](https://codecov.io/gh/amigo-ai/amigo-typescript-sdk/graph/badge.svg?token=PQU5JBU941)](https://codecov.io/gh/amigo-ai/amigo-typescript-sdk)
5
+ [![npm version](https://img.shields.io/npm/v/%40amigo-ai%2Fsdk?logo=npm)](https://www.npmjs.com/package/@amigo-ai/sdk)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ The official TypeScript SDK for the Amigo API, providing a simple and intuitive interface to interact with Amigo's AI services.
9
+
10
+ ## Installation
11
+
12
+ Install the SDK using npm:
13
+
14
+ ```bash
15
+ npm install @amigo-ai/sdk
16
+ ```
17
+
18
+ ## Quick Start
19
+
20
+ ```typescript
21
+ import { AmigoClient } from '@amigo-ai/sdk'
22
+
23
+ // Initialize the client
24
+ const client = new AmigoClient({
25
+ apiKey: 'your-api-key',
26
+ apiKeyId: 'your-api-key-id',
27
+ userId: 'user-id',
28
+ orgId: 'your-organization-id',
29
+ })
30
+
31
+ // List recent conversations
32
+ async function example() {
33
+ try {
34
+ const conversations = await client.conversations.getConversations({
35
+ limit: 10,
36
+ sort_by: ['-created_at'],
37
+ })
38
+ console.log('Conversations:', conversations)
39
+ } catch (error) {
40
+ console.error('Error:', error)
41
+ }
42
+ }
43
+
44
+ example()
45
+ ```
46
+
47
+ ## Configuration
48
+
49
+ The SDK requires the following configuration parameters:
50
+
51
+ | Parameter | Type | Required | Description |
52
+ | ---------- | ------ | -------- | -------------------------------------------------------------- |
53
+ | `apiKey` | string | ✅ | API key from Amigo dashboard |
54
+ | `apiKeyId` | string | ✅ | API key ID from Amigo dashboard |
55
+ | `userId` | string | ✅ | User ID on whose behalf the request is made |
56
+ | `orgId` | string | ✅ | Your organization ID |
57
+ | `baseUrl` | string | ❌ | Base URL of the Amigo API (defaults to `https://api.amigo.ai`) |
58
+
59
+ ### Getting Your API Credentials
60
+
61
+ 1. **API Key & API Key ID**: Generate these from your Amigo admin dashboard or programmatically using the API
62
+ 2. **Organization ID**: Found in your Amigo dashboard URL or organization settings
63
+ 3. **User ID**: The ID of the user you want to impersonate for API calls
64
+
65
+ For detailed instructions on generating API keys, see the [Authentication Guide](https://docs.amigo.ai/developer-guide).
66
+
67
+ ### API compatibility
68
+
69
+ This SDK auto-generates its types from the latest Amigo OpenAPI schema. As a result, only the latest published SDK version is guaranteed to match the current API. If you pin to an older version, it may not include the newest endpoints or fields.
70
+
71
+ ## Error Handling
72
+
73
+ The SDK provides typed error handling:
74
+
75
+ ```typescript
76
+ import { AmigoClient, errors } from '@amigo-ai/sdk'
77
+
78
+ try {
79
+ const result = await client.organizations.getOrganization('org-id')
80
+ } catch (error) {
81
+ if (error instanceof errors.AuthenticationError) {
82
+ console.error('Authentication failed:', error.message)
83
+ } else if (error instanceof errors.NetworkError) {
84
+ console.error('Network error:', error.message)
85
+ } else {
86
+ console.error('Unexpected error:', error)
87
+ }
88
+ }
89
+ ```
90
+
91
+ ## Documentation
92
+
93
+ - **Developer Guide**: [https://docs.amigo.ai/developer-guide](https://docs.amigo.ai/developer-guide)
94
+ - **API Reference**: [https://docs.amigo.ai/api-reference](https://docs.amigo.ai/api-reference)
95
+
96
+ ## License
97
+
98
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
99
+
100
+ ## Support
101
+
102
+ For questions, issues, or feature requests, please visit our [GitHub repository](https://github.com/amigo-ai/amigo-typescript-sdk) or contact support through the Amigo dashboard.