Docs / integrations / useIntegrations

useIntegrations

hooknot for built apps

Register any HTTPS REST API as a named integration the agent can call as a tool, with credentials encrypted at rest.

import { useIntegrations } from 'flowstack-sdk'

Register any HTTPS REST API as a named integration that the agent can call as a tool. Credentials are encrypted at rest; raw secrets are never returned after creation.

Supported auth_type values: 'bearer', 'api_key_header', 'api_key_query', 'basic', 'none'.

Signature

const { integrations, isLoading, error, create, update, remove, get, refresh } = useIntegrations()

Returns

FieldTypeDescription
integrationsIntegration[]Registered integrations, e.g. [{integration_id, name, base_url, auth_type, endpoint_count, ...}].
isLoadingbooleanRequest in flight.
errorstring | nullLast error message.
create(input) => Promise<Integration | null>Register a new integration (name, description, base_url, auth_type, auth_config, endpoints).
update(id, input) => Promise<boolean>Update an integration, e.g. rotate credentials.
remove(id) => Promise<boolean>Delete an integration.
get(id) => Promise<Integration | null>Fetch a single integration, including its full endpoint list.
refresh() => Promise<void>Re-fetch the integrations list.

Examples

Register, update, and remove an integration
import { useIntegrations } from 'flowstack-sdk';

const { integrations, create, update, remove, isLoading } = useIntegrations();

// Register Shopify
await create({
  name: 'Shopify',
  description: 'Shopify Admin API for order and product management',
  base_url: 'https://my-store.myshopify.com/admin/api/2024-01',
  auth_type: 'bearer',          // 'bearer' | 'api_key_header' | 'api_key_query' | 'basic' | 'none'
  auth_config: { token: 'shpat_xxx' },
  endpoints: [
    { name: 'list_orders', method: 'GET',  path: '/orders.json' },
    { name: 'get_order',   method: 'GET',  path: '/orders/{id}.json' },
    { name: 'cancel_order',method: 'POST', path: '/orders/{id}/cancel.json' },
  ],
});

// Update credentials
await update(id, { auth_config: { token: 'new_token' } });

// Remove
await remove(id);
NoteCredentials are encrypted at rest; raw secrets are never returned after creation.

See also

useAutomations · useConnections · useDataSources

Source: README.md#useintegrations · Also available in llms-full.txt and registry.json.