Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,25 @@ const amy = Agent({
integrations: ['chat', 'slack', 'email', 'zendesk', 'shopify'],
triggers: ['onTicketCreated', 'onMessageReceived'],
searches: ['FAQs', 'Tickets', 'Orders', 'Products', 'Customers'],
actions: ['sendMessage', 'updateOrder', 'refundOrder', 'resolveTicket', 'escalateTicket'],
actions: ['sendMessage', 'updateOrder', 'refundOrder', 'resolveTicket', 'escalateTicket'],
})
```

### [Integrations.do](https://integrations.do) Connect External APIs

```ts
import { integrations } from 'integrations.do'

// View available integrations
const services = await integrations.list()

// Connect to GitHub using an API token
const connection = await integrations.connect('github', { type: 'apiKey', apiKey: process.env.GITHUB_TOKEN })

// Later disconnect when no longer needed
await integrations.deleteConnection(connection.id)
```

### [Humans.do](https://humans.do) Tasks in a Workflow

```ts
Expand Down
16 changes: 11 additions & 5 deletions sdks/integrations.do/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import { API } from 'apis.do'

export class CLI {
private api: API

constructor(options: { apiKey?: string; baseUrl?: string } = {}) {
this.api = new API({ apiKey: options.apiKey, baseUrl: options.baseUrl })
}

async listIntegrations() {
return []
return this.api.get('/integrations')
}

async connect(integration: string, options: { token?: string } = {}) {
console.log(`Connecting to ${integration}...`)
return { success: true, integration }
return this.api.post(`/integrations/${integration}/connect`, options)
}

async disconnect(integration: string) {
console.log(`Disconnecting from ${integration}...`)
return { success: true, integration }
return this.api.post(`/integrations/${integration}/disconnect`, {})
}
}
Loading