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

@icewheel-oss/icewheel-energy-key-beacon-cloud-function

v1.0.3

Published

Single-file Google Cloud Function that serves a client-side web app.

Readme

Icewheel Energy Key Beacon — Cloud Run Deployment

This project provides a minimal, single-file, self-contained web application designed to help you manage your Tesla Fleet API integration. It serves two main purposes:

  1. Hosts Your Public Key: It serves your public key at the required URL for Tesla to validate your domain.
    • GET /.well-known/appspecific/com.tesla.3p.public-key.pem → Serves your configured public key (PEM).
  2. Provides a User Interface: It offers a simple web page to generate a partner token, register your domain, and verify the setup, with all API calls happening securely on the server side.

Demo

A demo deployment for development environment is at https://beacon-function.icewheel.dev/ to try only and then users can do their own deployment

This guide focuses on deploying the application to Google Cloud Run, which is the recommended platform.

Disclaimer

The instructions provided in this guide are for educational purposes and are meant to be a helpful starting point. Cloud provider interfaces and command-line tools change over time. You are encouraged to supplement this guide with official documentation from Google Cloud and other learning resources like video tutorials.

The user is solely responsible for their own setup, including any costs incurred or issues that may arise. We are not liable for any problems or damages resulting from following these instructions.

Why Google Cloud Run?

  • Free Tier: Cloud Run has a generous free tier. For this app's usage, it will likely cost you nothing.
  • Automatic HTTPS: You get a secure, trusted https:// URL for your service automatically, which is a requirement for the Tesla API.
  • Serverless & Cost-Effective: The service can "scale to zero," meaning you are not charged when it's not in use. It wakes up instantly when a request comes in.

Deployment to Google Cloud Run

You have two options for deployment. The first is the easiest if you prefer using a user interface.

Option 1: Deploy via the Google Cloud Console (Easy Method)

This method uses the inline editor in the Google Cloud Console, so you don't need to install any tools.

  1. Navigate to Cloud Run:

    • Go to the Google Cloud Run page in the Google Cloud Console.
    • Click "Write a function".
  2. Initial Service Configuration:

    • Service name: Choose a name for your service (e.g., icewheel-energy-beacon).
    • Region: Select a region close to you.
    • Runtime: Choose Node.js 22 (or a suitable version).
    • Authentication: Select "Allow unauthenticated invocations".
    • Billing: Choose your preferred option.
  3. Advanced Settings:

    • Scaling: Set Minimum number of instances to 0 and Maximum number of instances to 1.
    • Ingress: Select "All".
    • Container: Set Memory to 256MB (128MB is also fine) and CPU to 1.
    • Variables & Secrets: Add an environment variable with the Name TESLA_PUBLIC_KEY and your public key as the Value.
  4. Create the Service:

    • Click "Create". This will provision the service and take you to the inline editor.
  5. Add Code and Deploy:

    • In the editor, you will see index.js and package.json files.
    • index.js: Replace the default content with the content of this project's index.js file.
    • package.json: Replace the default content with the content of this project's package.json file.
    • Entry point: Set the Function entry point to beacon.
    • Click "Save and redeploy" to deploy your function.

Option 2: Deploy via the Command Line (gcloud)

If you have the gcloud command-line tool installed, you can deploy the service with a single command from the project's root directory.

# Make sure to replace YOUR_SERVICE_NAME, YOUR_REGION, and YOUR_PUBLIC_KEY
gcloud run deploy YOUR_SERVICE_NAME \
  --source . \
  --region YOUR_REGION \
  --runtime nodejs22 \
  --entry-point beacon \
  --allow-unauthenticated \
  --set-env-vars="TESLA_PUBLIC_KEY=YOUR_PUBLIC_KEY" \
  --min-instances=0 \
  --max-instances=1

What this command does:

  • gcloud run deploy YOUR_SERVICE_NAME: Deploys a Cloud Run service with the name you provide.
  • --source .: Uploads the code from your current directory.
  • --region YOUR_REGION: Specifies the Google Cloud region for the deployment.
  • --runtime nodejs22: Sets the runtime environment to Node.js 22.
  • --entry-point beacon: Specifies the name of the function to execute.
  • --allow-unauthenticated: Makes the web app publicly accessible.
  • --set-env-vars: Sets your Tesla public key as an environment variable.
  • --min-instances=0: Sets the service to scale to zero to save costs.
  • --max-instances=1: Prevents the service from scaling beyond one instance.

Verification

After deploying your service, you can verify that the public key is being served correctly by visiting the following URL in your browser:

https://YOUR_SERVICE_URL/.well-known/appspecific/com.tesla.3p.public-key.pem

Replace YOUR_SERVICE_URL with the URL of your deployed Cloud Run service. You should see your public key displayed in the browser.


Optional: Custom Domain Mapping

If you own a domain name, you can map it to your Cloud Run service to use a custom URL.

  1. After your service is deployed, navigate to the "Domain mappings" section from the left-side menu in the Cloud Run page.
  2. Follow the instructions to add a new domain mapping and verify your domain ownership.

Local Development (Optional)

If you want to run the app on your local machine before deploying:

  1. Install dependencies:
    npm install
  2. Run the app:
    npm start
  • The function will be available at http://localhost:8080.