ApiKeyStrategy class

Attaches a static API key to every request as an x-api-key header. The key is a compile-time constant — never stored dynamically.

Individual requests opt out via noAuth: true.

@Deprecated — not yet implemented on the backend. Uncomment and configure once backend API key support is ready.

Inheritance

Constructors

ApiKeyStrategy({required String apiKey})
const

Properties

apiKey String
The API key constant. Pass from your app-level config.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

apply(RequestOptions options) Future<void>
Attach auth credentials to options before the request is sent.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onUnauthorized() Future<void>
Called when the API layer receives a 401. Use to trigger token refresh or logout in your app provider.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited