-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic_usage.js
More file actions
32 lines (25 loc) · 842 Bytes
/
basic_usage.js
File metadata and controls
32 lines (25 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { BundleUp } from '../dist/index.js';
const apiKey = process.env.BUNDLEUP_API_KEY;
if (!apiKey) {
throw new Error('BUNDLEUP_API_KEY is required');
}
const client = new BundleUp(apiKey);
console.log('BundleUp JavaScript SDK: basic usage');
try {
const connections = await client.connections.list();
console.log(`Connections: ${connections.length}`);
} catch (error) {
console.error(`Failed to list connections: ${error.message}`);
}
try {
const integrations = await client.integrations.list();
console.log(`Integrations: ${integrations.length}`);
} catch (error) {
console.error(`Failed to list integrations: ${error.message}`);
}
try {
const webhooks = await client.webhooks.list();
console.log(`Webhooks: ${webhooks.length}`);
} catch (error) {
console.error(`Failed to list webhooks: ${error.message}`);
}