Skip to content

Instantly share code, notes, and snippets.

@Tech500
Last active February 3, 2026 04:15
Show Gist options
  • Select an option

  • Save Tech500/2a3c6876ac798ab0e8a18c8c1e9c3f67 to your computer and use it in GitHub Desktop.

Select an option

Save Tech500/2a3c6876ac798ab0e8a18c8c1e9c3f67 to your computer and use it in GitHub Desktop.
Using Wyze api credentials for Docker --Wyze-Bridge

Using Wyze API Credentials for Docker Wyze-Bridge

Overview

The API_ID is required alongside API_KEY to authenticate with the Wyze API and bypass two-factor authentication (2FA). As of April 2024, Wyze deprecated 2FA login methods, making API Key/ID the recommended authentication method for WyzeBridge.

Purpose

Using API_ID and API_KEY eliminates the need for email/password login and avoids 2FA prompts.

How to Obtain Credentials

Generate both API_ID and API_KEY from the Wyze Developer Console.

Usage in Docker

Option 1: Environment Variables

environment:
  - WYZE_EMAIL=your_email
  - WYZE_PASSWORD=your_password
  - API_ID=your_api_id
  - API_KEY=your_api_key

Option 2: Docker Secrets (Recommended)

Define secrets in your docker-compose.yml:

secrets:
  - API_ID
  - API_KEY

Ensure the secret files (wyze_api_id.txt, wyze_api_key.txt) are correctly mounted under /run/secrets/.

Important: Ensure secret names in docker-compose.yml match exactly (API_ID, not WYZE_API_ID or similar). Mismatched names are a common cause of credentials not being read.

Example Docker Compose Using Secrets

version: '3.8'

services:
  wyze-bridge:
    image: idisposablegithub365/wyze-bridge:latest
    container_name: wyze-bridge
    restart: unless-stopped
    ports:
      - "5000:5000"
      - "8554:8554"
    secrets:
      - WYZE_EMAIL
      - WYZE_PASSWORD
      - API_ID
      - API_KEY
    environment:
      - WB_AUTH=True

secrets:
  WYZE_EMAIL:
    file: ./secrets/wyze_email.txt
  WYZE_PASSWORD:
    file: ./secrets/wyze_password.txt
  API_ID:
    file: ./secrets/wyze_api_id.txt
  API_KEY:
    file: ./secrets/wyze_api_key.txt

Important Notes

File Permissions

Ensure secret files are readable (e.g., chmod 600).

No Environment Variable Substitution

Do not set WYZE_EMAIL=/run/secrets/WYZE_EMAIL; the container automatically reads them from /run/secrets/ when defined in secrets.

Testing

After starting, check logs with docker logs wyze-bridge for authentication success.

Creating Secret Files

Place the actual API_KEY value inside the secret file, not in the docker-compose.yml.

  1. Create a file (e.g., ./secrets/wyze_api_key.txt)

  2. Put only the API key inside:

    your_actual_api_key_here
    
  3. Ensure docker-compose.yml references it:

    secrets:
      API_KEY:
        file: ./secrets/wyze_api_key.txt

The container reads /run/secrets/API_KEY automatically.

Folder Structure

The .secrets folder is not a standard or required name—you can name it anything (e.g., secrets, .secrets, config, etc.).

Location

Place it in your project directory (e.g., alongside docker-compose.yml).

Example Structure

your-project/
├── docker-compose.yml
└── .secrets/
    ├── wyze_email.txt
    ├── wyze_password.txt
    ├── wyze_api_id.txt
    └── wyze_api_key.txt

In docker-compose.yml

secrets:
  API_KEY:
    file: ./.secrets/wyze_api_key.txt

Docker mounts the file to /run/secrets/API_KEY automatically.

Ensure the folder and files are readable and paths are correct.

Troubleshooting

  • Secret names must match exactly in both the service's secrets: list and the root-level secrets: definitions
  • Check file paths - ensure secret files exist at the specified locations
  • Verify permissions - secret files should be readable by the Docker daemon
  • Review logs - use docker logs wyze-bridge to check for authentication errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment