Getting Started
Copy a setup prompt with the install steps and the full markdown guide for this plugin.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-auto`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/auto/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
-
Install the package
Terminal window npm i @capgo/capacitor-auto -
Sync native projects
Terminal window npx cap sync -
Set the root car template
import { Auto } from '@capgo/capacitor-auto';await Auto.setRootTemplate({title: 'Garage',sections: [{header: 'Doors',items: [{id: 'open-main-door',title: 'Open main door',subtitle: 'Tap to send the action to the phone app',payload: { doorId: 'main' },},],},],}); -
Handle car actions
await Auto.addListener('carAction', async (event) => {if (event.id === 'open-main-door') {await openGarageDoor(event.payload?.doorId);}}); -
Track connection state
const status = await Auto.isAvailable();console.log(status.available, status.connected, status.platform);await Auto.addListener('connectionChanged', (event) => {console.log('Car connected:', event.connected, event.platform);});
Empty state
Section titled “Empty state”Set emptyText when the template has no rows:
await Auto.setRootTemplate({ title: 'Garage', emptyText: 'No actions are available right now.', sections: [],});Send bridge messages
Section titled “Send bridge messages”Use sendMessage for application-defined native bridge messages:
await Auto.sendMessage({ type: 'status', payload: { online: true },});Platform setup
Section titled “Platform setup”- Follow the iOS setup page for CarPlay scene and entitlement notes.
- Follow the Android setup page for Android Auto category and manifest notes.