npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-car-projection

v1.0.0

Published

React Native module for Android Auto and CarPlay integration

Readme

React Native Car Projection [VIBE CODED]

⚠️ NOTE: I am not a native mobile developer, so I vibe-coded this for my own purposes. Use at your own risk.

A modern React Native module for integrating Android Auto and CarPlay functionality using the Car App Library and Expo Modules API. Built for Expo SDK 53+ with React Native 0.79 and React 19 support.

🚀 Features

  • Modern Architecture: Built with Expo Modules API and Android Car App Library
  • Expo SDK 53+ Compatible: Works with React Native 0.79 and React 19
  • TypeScript Support: Full TypeScript definitions included
  • Template System: ListTemplate, MessageTemplate, and more
  • Easy Integration: Simple setup with config plugin
  • Event Handling: React to user interactions and navigation changes
  • New Architecture Ready: Supports React Native's new architecture

📋 Prerequisites

  • Expo SDK 53 or later
  • React Native 0.79+
  • React 19+
  • Android API level 23+
  • Android Auto app installed on device

🏁 Installation

1. Install the module

npm install react-native-car-projection
# or
yarn add react-native-car-projection

2. Add the config plugin

Add the plugin to your app.json or expo.json:

{
  "expo": {
    "plugins": [
      [
        "react-native-car-projection",
        {
          "carAppCategory": "navigation",
          "minCarApiLevel": 1,
          "targetCarApiLevel": 6
        }
      ]
    ]
  }
}

3. Rebuild your app

npx expo prebuild --clean
npx expo run:android

Example apps (app types)

The plugin supports three app types. Example apps for each are available in the TestCarProjection repository under the examples/ directory:

| Type | Config | Description | Example app | |------|--------|-------------|-------------| | Car App only (no media) | mediaSupport: false, mediaOnly: false, carAppCategory e.g. "navigation" | No MediaBrowserService. Car App template UI only. | examples/TestCarAppOnly | | Car App + media | mediaOnly: false, mediaSupport: true | Car App Service and MediaBrowserService. Template UI and now-playing slot. | examples/TestCarAppPlusMedia | | Media only | mediaOnly: true, mediaSupport: true | MediaBrowserService only (no Car App). Browse + now-playing, like Spotify. | examples/TestMediaOnly |

Each example app runs on both iOS and Android; Android Auto–specific behavior applies on Android when connected to a head unit or DHU. See examples/README.md for how to run them.

🎯 Quick Start

import React, { useEffect } from 'react';
import CarProjection, { createListTemplate } from 'react-native-car-projection';

export default function App() {
  useEffect(() => {
    // Register your root screen
    CarProjection.registerScreen({
      name: 'root',
      template: createListTemplate({
        title: 'My App',
        header: 'Main Menu',
        items: [
          {
            title: 'Navigation',
            texts: ['Start navigation'],
            onPress: () => {}
          }
        ]
      })
    });

    // Start the session
    CarProjection.startSession();
  }, []);

  return <YourAppContent />;
}

Media-only mode: browse content (setMediaBrowseTree)

When using mediaOnly: true, you can set the MediaBrowser browse tree so the car shows available items (e.g. Recently Played, playlists, tracks). Call setMediaBrowseTree with a map where keys are parent IDs and values are arrays of MediaItem. The root key must be "__ROOT__". Use addMediaPlayFromIdListener to start playback when the user taps a playable item.

// Example: root with one folder and one track
await CarProjection.setMediaBrowseTree({
  __ROOT__: [
    { id: 'playlist_1', title: 'Recently Played', browsable: true, playable: false },
    { id: 'track_1', title: 'Song Title', artist: 'Artist', playable: true },
  ],
  playlist_1: [
    { id: 'track_2', title: 'Another Song', artist: 'Artist', playable: true },
  ],
});

CarProjection.addMediaPlayFromIdListener((event) => {
  // Start playing the track with id event.mediaId
  playTrackById(event.mediaId);
});

For more detailed documentation, see the full README in the repository.