@vybe-adk/app-lib
v0.0.3
Published
`client-lib/integrations-client`. Run an action on a connected integration.
Readme
@vybe-adk/app-lib
Integrations
runIntegrationAction — client-side
client-lib/integrations-client. Run an action on a connected integration.
import { runIntegrationAction } from "@/client-lib/integrations-client";
const result = await runIntegrationAction({
accountId: "acc_123", // from the connected integrations list
actionId: "send-message", // tool name, used as-is
input: { channel: "#general", text: "Hello!" },
});
// result has the same shape as the tool outputrunIntegrationActionFromServer — server-side
server-lib/server-integrations-client. Same operation from server-side code.
import { runIntegrationActionFromServer } from "@/server-lib/server-integrations-client";
const result = await runIntegrationActionFromServer({
accountId: "acc_123",
actionId: "send-message",
input: { channel: "#general", text: "Hello from server!" },
});Built-in integrations
client-lib/built-in-integrations. Prefer these over third-party integrations.
| Module | Exports |
|---|---|
| ai | generateText, generateObject |
| crustdata | useCrustdataEnrichPerson |
| forager | foragerPersonalEmailsLookup |
| people-data-labs | enrichPerson, identifyPerson |
Response types live in shared/models/built-in-integrations/*.
Custom APIs
callCustomApi (client-lib/custom-api-client) and callCustomApiFromServer (server-lib/custom-api-client) call a configured custom API by id. Uploads go through the parts option, capped at MAX_CUSTOM_API_UPLOAD_BYTES.
Databases
| Function | Module | Purpose |
|---|---|---|
| queryInternalDatabase | internal-db-query | the app's own database |
| queryOrganizationDatabase, queryOrganizationDatabaseById | organization-db-query | organization databases |
| queryExternalDatabasePostgres | external-db-postgres | connected Postgres |
| queryExternalDatabaseMySQL | external-db-mysql | connected MySQL |
| queryExternalDatabaseRedshift | external-db-redshift | connected Redshift |
Data queries
runDataQuery (client-lib/data-query-client) runs a saved data query by name.
Organization
getEmployees (server-lib/employees) returns the employees of the current organization — its Vybe members, merged with its Slack workspace members when a Slack integration is connected.
import { getEmployees } from "@/server-lib/employees";
const employees = await getEmployees();
// [ { name: "Alice Doe", email: "[email protected]" }, ... ]Each entry is an Employee: name, and email which is null when unknown.
