0

Get detailed list of integrations

by
Published Oct 17, 2025

Retrieve a detailed list of supported integrations, optionally filtered by the developer's enabled integrations and the requirement for SDK usage.

Script terra Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Get detailed list of integrations
4
 * Retrieve a detailed list of supported integrations, optionally filtered by the developer's enabled integrations and the requirement for SDK usage.
5
 */
6
export async function main(auth: RT.Terra, sdk?: string | undefined) {
7
	const url = new URL(`https://api.tryterra.co/v2/integrations/detailed`)
8
	for (const [k, v] of [['sdk', sdk]]) {
9
		if (v !== undefined && v !== '') {
10
			url.searchParams.append(k, v)
11
		}
12
	}
13
	const response = await fetch(url, {
14
		method: 'GET',
15
		headers: {
16
			'dev-id': auth.devId,
17
			'X-api-key': auth.apiKey
18
		},
19
		body: undefined
20
	})
21
	if (!response.ok) {
22
		const text = await response.text()
23
		throw new Error(`${response.status} ${text}`)
24
	}
25
	return await response.json()
26
}
27