Skip to main content

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.

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

# Run commands
zeysdk [command]

Platform-Specific Commands

Windows CMD:

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

Windows PowerShell:

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

Linux/macOS:

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.

# 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

  • Tokens are stored securely using system keychain
  • 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