callOptions property
inherited
Creates CallOptions with authentication metadata and correlation ID.
Call this to get options with the Bearer token and correlation ID injected. A unique correlation ID is generated per call for end-to-end tracing.
Implementation
CallOptions get callOptions {
final correlationId = _generateCorrelationId();
final metadata = <String, String>{
'x-correlation-id': correlationId,
};
if (_token != null && _token!.isNotEmpty) {
metadata['authorization'] = 'Bearer $_token';
}
// Add tenant ID for anonymous public access
if (_tenantId != null && _tenantId!.isNotEmpty) {
metadata['x-tenant-id'] = _tenantId!;
}
return CallOptions(metadata: metadata);
}