class documentation

Bearer that reads the token from an environment variable.

Example

Construct a bearer and use it to initialize the SDK:

import os
from nebius.sdk import SDK
from nebius.aio.token.static import EnvBearer

os.environ["NEBIUS_IAM_TOKEN"] = "token-from-env"
sdk = SDK(credentials=EnvBearer())
Parameters
env_var_nameEnvironment variable name to read the token from. Defaults to nebius.base.constants.TOKEN_ENV.
Raises
NoTokenInEnvErrorWhen the environment variable is not set or empty.
Method __init__ Initialize the environment-variable based bearer.

Inherited from Bearer:

Method receiver Return a Receiver that yields the configured token.
Instance Variable _tok Undocumented

Inherited from Bearer (via Bearer):

Async Method close Close the bearer and any wrapped resources.
Property name Optional human-readable name for the bearer.
Property wrapped Return the wrapped bearer or None if not wrapping.
def __init__(self, env_var_name: str = TOKEN_ENV): (source) ΒΆ

Initialize the environment-variable based bearer.