Skip to content

fyers_credentials.yaml

Controls FYERS authentication and token persistence.

Used By

  • src/fyers/auth.py
  • REST adapter startup (FyersSdkRestAdapter.start)

Required Fields

  • version: 1
  • totp_key
  • username
  • pin
  • client_id
  • app_id
  • app_type
  • secret_key
  • redirect_uri

Optional Fields

  • token_path (default: secrets/fyers_token.json)
  • token_refresh_time_ist (default: 06:30)
  • request_timeout_seconds (default: 15)
  • auth_max_retries (default: 2)
  • auth_backoff_base_seconds (default: 0.5)
  • auth_backoff_max_seconds (default: 5.0)
  • auth_backoff_jitter_seconds (default: 0.25)
  • log_path (defaults to resolver logs directory)

Safe Defaults

Use short timeouts and low retry counts to avoid hanging login attempts.

Dangerous Values

  • Very high retries or timeouts can block startup for minutes.
  • Storing the file in a shared path with insecure permissions.

Example

version: 1
totp_key: "YOUR_TOTP_KEY"
username: "YOUR_USERNAME"
pin: "YOUR_PIN"
client_id: "APP_ID-100"
app_id: "APP_ID"
app_type: "APP_TYPE"
secret_key: "APP_SECRET"
redirect_uri: "https://your.redirect/uri"
request_timeout_seconds: 15
auth_max_retries: 2
auth_backoff_base_seconds: 0.5
auth_backoff_max_seconds: 5.0
auth_backoff_jitter_seconds: 0.25

Scenario Example

Scenario: Auth requests hang during startup. - Decrease request_timeout_seconds. - Keep auth_max_retries low to avoid long startup delays.