Skip to main content
@capgo/capacitor-auto Device APIs Open source

Auto Capacitor plugin

Bridge Capacitor apps with CarPlay and Android Auto template surfaces for two-way car communication

Install

bun add @capgo/capacitor-auto bunx cap sync
npm, pnpm or yarn
  • npm install @capgo/capacitor-auto
  • pnpm add @capgo/capacitor-auto
  • yarn add @capgo/capacitor-auto

Guide

How to use Auto in Capacitor

Using @capgo/capacitor-auto

@capgo/capacitor-auto connects a Capacitor app to approved CarPlay and Android Auto template surfaces. Your app sends a small list template to the car display, and the car display sends selected actions back to JavaScript.

It is built for driver-safe, policy-controlled workflows. It does not mirror your WebView into the car.

Install and sync

npm install @capgo/capacitor-auto
npx cap sync

Send a template to the car

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' },
        },
      ],
    },
  ],
});

Listen for driver actions

await Auto.addListener('carAction', async (event) => {
  if (event.id === 'open-main-door') {
    await openGarageDoor(event.payload?.doorId);
  }
});

Watch 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);
});

iOS requirements

CarPlay requires an Apple-approved entitlement for your app category. Add the CarPlay scene configuration described in the iOS setup docs and keep your car UI inside Apple-approved templates.

Android requirements

Android Auto uses AndroidX Car App Library. The plugin includes a CarAppService, declares the template capability, and defaults to the IOT category. Review the Android setup docs if your app needs another Android Auto category.

Design guidance

Use the car surface for short, predictable actions:

  • status rows
  • one-tap commands
  • driver-safe confirmations
  • simple state handoff from the phone app

Keep complex flows in the phone UI and use carAction events as native intent triggers.

Keep going from Using @capgo/capacitor-auto

If you are using Using @capgo/capacitor-auto to plan native media and interface behavior, connect it with @capgo/capacitor-auto for the implementation detail in @capgo/capacitor-auto, Getting Started for the implementation detail in Getting Started, Using @capgo/capacitor-live-activities for the native capability in Using @capgo/capacitor-live-activities, @capgo/capacitor-live-activities for the implementation detail in @capgo/capacitor-live-activities, and Using @capgo/capacitor-video-player for the native capability in Using @capgo/capacitor-video-player.

FAQ

Auto plugin FAQ

How do I install the Auto plugin in a Capacitor app?

Run "bun add @capgo/capacitor-auto" (or "npm install @capgo/capacitor-auto"), then run "bunx cap sync" so the iOS and Android projects pick up the native code. Import it from "@capgo/capacitor-auto" in your app code.

Does @capgo/capacitor-auto work with React, Vue and Angular?

Yes. Auto is a Capacitor package, so it works with any web framework that runs inside Capacitor, including Ionic, React, Vue, Angular, Svelte and plain JavaScript.

Which Capacitor version does @capgo/capacitor-auto support?

Capgo plugins follow Capacitor's major version: use the plugin major version that matches your Capacitor major version (for example plugin v8 with Capacitor 8). The compatibility table in the GitHub README lists the maintained versions.

Is @capgo/capacitor-auto free and open source?

Yes. The source code is public on GitHub at https://github.com/Cap-go/capacitor-auto/ and the package is free to install from npm. Bug reports and pull requests are welcome.

Can I update code that uses Auto without an App Store review?

Installing or upgrading the plugin changes native code, so it needs a new store build. After that, JavaScript, HTML and CSS changes that call the plugin can ship instantly with Capgo live updates.

Ship Auto changes without waiting for app review

Once the plugin is in your store build, Capgo live updates push your JavaScript, HTML and CSS changes to users in minutes.

Start with Capgo