Zum Hauptinhalt springen

Authentication

The SDK supports two authentication methods for connecting to ZeyOS instances:

Environment variables are the recommended method for CI/CD environments and automated workflows.

Bash
# Set environment variables
ZEYSDK_TOKEN=your_token
ZEYSDK_SERVER=https://cloud.zeyos.com/your_instance

# Run commands
zeysdk [command]

Platform-Specific Commands​

Windows CMD:

CMD
set ZEYSDK_TOKEN=your_token && set ZEYSDK_SERVER=https://cloud.zeyos.com/your_instance && zeysdk [command]

Windows PowerShell:

PowerShell
$env:ZEYSDK_TOKEN="your_token"; $env:ZEYSDK_SERVER="https://cloud.zeyos.com/your_instance"; zeysdk [command]

Linux/macOS:

Bash
export ZEYSDK_TOKEN=your_token && export ZEYSDK_SERVER=https://cloud.zeyos.com/your_instance && zeysdk [command]

2. Stored Credentials (Default for local development)​

For local development, the SDK uses stored credentials by default.

Bash
# Link your instance first
zeysdk link

# Then run commands
zeysdk [command]

Authentication Priority​

Environment variables take precedence over stored credentials. When both are available, the SDK will use the environment variables.

Security Notes​

  • Stored credentials can use OS keychain or file store (configure with zeysdk configure -> Credential Storage)
  • Environment variables are cleared when the terminal session ends
  • Stored credentials persist between sessions
  • Use environment variables for CI/CD to avoid storing credentials
  • Use stored credentials for local development convenience

Error Handling​

ErrorDescriptionResolution
Missing tokenNo authentication providedSet environment variables or run zeysdk link
Invalid tokenBad credentialsCheck token validity
Server errorInvalid server URLVerify server URL format
Network errorConnection failedCheck connectivity