Membrane SDK - v0.29.2
    Preparing search index...

    Class IntegrationAppClient

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    apiUri: string
    uiUri: string
    token?: string
    fetchToken?: () => Promise<string>

    Accessors

    • Parameters

      • selector:
            | string
            | {
                id?: string;
                type?: Integration;
                key?: string;
                autoCreate?: boolean;
                connectionId?: string;
            }

      Returns ScreenAccessor

    • get ui(): UI

      UI namespace for opening UI screens.

      Returns UI

    Methods

    • Parameters

      • credentials: any

      Returns Promise<any>

    • Returns a valid access token. When using workspace credentials, mints a fresh JWT on demand. The returned token is valid for at least 60 seconds.

      Returns Promise<string>

    • Type Parameters

      • T = any

      Parameters

      • uri: string
      • OptionalqueryParams: Record<string, any>
      • Optionaloptions: AxiosRequestConfig<any, any>

      Returns Promise<T>

    post

    • post<T = any>(
          uri: string,
          data?: any,
          options?: AxiosRequestConfig<any, any>,
      ): Promise<T>

      Type Parameters

      • T = any

      Parameters

      • uri: string
      • Optionaldata: any
      • Optionaloptions: AxiosRequestConfig<any, any>

      Returns Promise<T>

    • Type Parameters

      • T = any

      Parameters

      • uri: string
      • Optionaldata: any
      • Optionaloptions: AxiosRequestConfig<any, any>

      Returns Promise<T>

    • Type Parameters

      • T = any

      Parameters

      • uri: string
      • Optionaldata: any
      • Optionaloptions: AxiosRequestConfig<any, any>

      Returns Promise<T>

    • Type Parameters

      • T = any

      Parameters

      • uri: string
      • Optionaldata: any
      • Optionaloptions: AxiosRequestConfig<any, any>

      Returns Promise<T>

    • Parameters

      • page: string
      • OptionalpageParams: Record<string, any>
      • Optionaloptions: { embedMode: "isolated-embed" | "popup-embed" }

      Returns Promise<string>

    • Get embed URI for SSR-based screens served from the API.

      Parameters

      • page: string
      • OptionalpageParams: Record<string, any>

      Returns Promise<string>

    • Get URL and POST data for SSR-based screens served from the API. This method returns data suitable for form submission to avoid putting tokens in URLs.

      Parameters

      • page: string
      • OptionalpageParams: Record<string, string | undefined>

      Returns Promise<{ url: string; postData: { token: string } }>

    • Creates or updates a connection programmatically (headless, no UI).

      • Provide integrationKey/integrationId to create a new connection for an integration
      • Provide connectorId (+ optional connectorVersion) to create a standalone connection
      • Provide connectionId to reconnect/update an existing connection

      For OAuth-based connections, this will open a popup for authentication. For API key or other credential-based auth, provide the credentials via the input option.

      Parameters

      Returns Promise<
          | {
              user?: {
                  id: string;
                  name: string;
                  meta?: Record<string, any>;
                  internalId: string;
                  fields?: Record<string, any>;
                  credentials?: any;
                  lastActiveAt?: string;
                  isTest?: boolean;
                  isBillable?: boolean;
                  isActive?: boolean;
                  aiCreditsRolling30DayLimit?: number | null;
                  createdAt?: string;
                  archivedAt?: string;
              };
              integration?: {
                  logoUri: string;
                  connectorId?: string;
                  connectorVersion?: string;
                  oAuthCallbackUri?: string;
                  parameters?: any;
                  archivedAt?: string;
                  hasMissingParameters?: boolean;
                  hasDocumentation?: boolean;
                  hasOperations?: boolean;
                  operationsCount?: number;
                  hasData?: boolean;
                  dataCollectionsCount?: number;
                  hasEvents?: boolean;
                  eventsCount?: number;
                  hasGlobalWebhooks?: boolean;
                  hasUdm?: boolean;
                  isTest?: boolean;
                  externalAppId?: string;
                  appUuid?: string;
                  isDeactivated?: boolean;
                  authType?: | "proxy"
                  | "integration-app-token"
                  | "membrane-token"
                  | "oauth2"
                  | "oauth1"
                  | "client-credentials";
                  optionsConfig?: Record<
                      string,
                      { disabled?: boolean; parameters?: Record<string, any> },
                  >;
                  id: string;
                  uuid?: string;
                  key?: string;
                  description?: string;
                  meta?: Record<string, any>;
                  name: string;
                  state?:
                      | BUILDING
                      | CLIENT_ACTION_REQUIRED
                      | CONFIGURATION_ERROR
                      | SETUP_FAILED
                      | READY
                      | DISCONNECTING;
                  errors?: ErrorDataSchema[];
                  revision?: string;
                  createdAt?: string;
                  updatedAt?: string;
                  isReadOnly?: boolean;
              };
              connectorParameters?: unknown;
              input?: unknown;
              type?: "connector"
              | "mcp";
              name: string;
              key?: string;
              isTest?: boolean;
              connected?: boolean;
              disconnected?: boolean;
              isDefunct?: boolean;
              state?:
                  | BUILDING
                  | CLIENT_ACTION_REQUIRED
                  | CONFIGURATION_ERROR
                  | SETUP_FAILED
                  | READY
                  | DISCONNECTING;
              errors?: ErrorDataSchema[];
              requestError?: ErrorDataSchema;
              error?: ErrorDataSchema;
              integrationId?: string;
              connectorId?: string;
              externalAppId?: string;
              connectorVersion?: string;
              authOptionKey?: string;
              createdAt: string;
              updatedAt: string;
              lastActiveAt?: string;
              nextCredentialsRefreshAt?: string;
              nextRetryTimestamp?: string;
              retryAttempts?: number;
              canTest?: boolean;
              canRefreshCredentials?: boolean;
              archivedAt?: string;
              isDeactivated?: boolean;
              meta?: Record<string, any>;
              buildingAgentSessionId?: string;
              clientAction?: {
                  type: "connect" | "provide-input";
                  description: string;
                  uiUrl?: string;
                  agentInstructions?: string;
                  handoffAgentInstructions?: string;
                  reason?: "provide-input" | "authenticate" | "reauthenticate";
              };
              id: string;
              userId: string;
              tenantId?: string;
          }
          | null,
      >

      // New connection with API key
      const conn = await client.connect({
      integrationKey: 'salesforce',
      authOptionKey: 'api-key',
      input: { apiKey: 'xxx' }
      })
      // Reconnect existing connection
      const conn = await client.connect({
      connectionId: 'conn_xxx',
      input: { apiKey: 'new-key' }
      })
    • Parameters

      • uri: string
      • OptionalqueryParams: Record<string, any>

      Returns Promise<EventSource>

    • Parameters

      • connectionId: string
      • uri: string
      • Optionaldata: any

      Returns Promise<any>

    Customers