Home / node / BaseClient / type-aliases / ServerCredentials @valkey/valkey-glide
@valkey/valkey-glide / BaseClient / ServerCredentials
Type Alias: ServerCredentials
ServerCredentials = {
password
:string
;username?
:string
; } | {iamConfig
:IamAuthConfig
;username
:string
; }
Represents the credentials for connecting to a server.
Type Declaration
{ password
: string
; username?
: string
; }
password
password:
string
The password that will be used for authenticating connections to the Valkey servers. (mutually exclusive with iamConfig).
username?
optional
username:string
The username that will be used for authenticating connections to the Valkey servers. If not supplied, "default" will be used.
{ iamConfig
: IamAuthConfig
; username
: string
; }
iamConfig
iamConfig:
IamAuthConfig
IAM config (mutually exclusive with password). The client will automatically generate and refresh the authentication token based on the provided configuration.
username
username:
string
Username is REQUIRED for IAM (Valkey AUTH