Skip to main content

SDK Overview

@appilots/sdk is a React Native package that embeds an AI chat UI in your app and gives an AI agent the ability to navigate screens, read what's on them, and operate them — pressing buttons, filling forms, flipping switches — on the user's behalf.

This page covers installation, the package's export surface, and the optional Metro plugin. For the actual wiring, continue to AppilotsProvider and AppilotsChat.

Requirements

@appilots/sdk declares these as peer dependencies — install them if your app doesn't already have them:

PackageMinimum version
react>=18.0.0
react-native>=0.72.0
react-native-safe-area-context>=4.0.0
react-native-svg>=13.0.0

Installation

npm install @appilots/sdk
yarn add @appilots/sdk
pnpm add @appilots/sdk

The SDK ships a Metro plugin that auto-loads your .appilotsrc file at bundle time. With it configured, AppilotsProvider needs zero props — no projectId or apiKey hardcoded in your app code.

metro.config.js
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
const { withAppilots } = require('@appilots/sdk/metro');

const config = {};

module.exports = withAppilots(mergeConfig(getDefaultConfig(__dirname), config));

See CLI configuration for the .appilotsrc file format. If you skip the Metro plugin, pass config explicitly to AppilotsProvider instead — both paths are covered in AppilotsProvider.

Package exports

The main entry point (@appilots/sdk) re-exports everything the SDK has to offer. Two narrower subpaths exist for consumers who want a smaller import surface — they don't expose anything the root doesn't already have:

SubpathContents
@appilots/sdkEverything below — the main entry point.
@appilots/sdk/navigationJust the navigation exports (AppilotsNavigationContainer, registerScreen, navigation types).
@appilots/sdk/hooksJust the hooks (useAppilots, useAppilotsField, etc).
@appilots/sdk/metroThe Metro plugin (withAppilots), CommonJS only, used from metro.config.js.

What's exported

GroupExportsPurpose
ProviderAppilotsProvider, useAppilotsContext, AppilotsConfigRoot context — see AppilotsProvider.
ChatAppilotsChat and its prop typesThe chat UI — see AppilotsChat.
ThemingAppilotsThemeProvider, useAppilotsTheme, defaultLightTheme, defaultDarkTheme, mergeThemeTokens, appilotsTheme, appilotsThemeFromTailwindToken-based theming — see Theming.
i18nAppilotsI18nProvider, useAppilotsI18n, detectDeviceLocale, resolveLocaleLocale detection and string bundles — see Customization: i18n.
UI piecesConfirmDialog, ActionBreadcrumb, ChatIcon, HeadsetIconStandalone components you can reuse in a custom chat surface.
HooksuseAppilots, useAppilotsNavigation, useAppilotsChat, useAppilotsActions, useAppilotsField, useAppilotsTarget, useAppilotsToggle, useAppilotsSlider, useSuggestedPromptsRead/write access to chat state, navigation state, and the component registry — see Hooks and Registering elements.
NavigationAppilotsNavigationContainer, registerScreen, ScreenMetadata, NavigationConfigScreen-level metadata for the agent — see Navigation.
RegistrycomponentRegistry, elementRegistry, listRegistry, createComponentRegistry, createElementRegistry, createListRegistry, AppilotsRegistryProvider, useResolvedRegistryThe low-level registry that the hooks, HOCs, and auto-tracking all write into. Most apps never touch this directly — the singleton registry is used automatically unless you explicitly scope a subtree with AppilotsRegistryProvider.
Config loadinginitAppilots, getGlobalConfigReads .appilotsrc at runtime (used by the Metro plugin path).
Auto-trackingenableAppilotsAutoTracking, isAutoTrackingEnabledZero-config component registration — see Registering elements.
Runtime snapshotcaptureSnapshot and its type exportsInternal runtime snapshot used to build the agent's context of the current screen.
HOC factoriescreateAppilotsInput, createAppilotsButton, createAppilotsSwitchWrap a shared component once so every usage auto-registers — see Registering elements.
ExecutorexecuteAction, ExecutorContext, ActionResultThe low-level action executor that the hooks and auto-tracking build on.
HTTP clientAppilotsClientThe client the provider builds from your config — see API Reference for the wire contract.
Core typesAgentAction, AgentActionType, AgentMessage, AgentPermissions, ChatMessage, FormFillPayload, NavigationPayload, UIInteractionPayload, AppilotsEvent, AppilotsEventType, AppilotsEventHandler, AppilotsTraceEntry, EscalationState, MessageRoleShared TypeScript types used across the public API.
VersionSDK_VERSIONThe installed SDK version string.

Next steps

  • AppilotsProvider — wrap your app and configure the SDK.
  • AppilotsChat — drop in the chat UI.
  • Navigation — describe your screens to the agent.
  • CLI overview — generate and sync the MCP document your project needs before the agent can do anything useful.