CommentsClient constructor

CommentsClient({
  1. required String baseUrl,
  2. required String apiKey,
  3. required CommentsExternalUser externalUser,
  4. CommentsUserRole role = CommentsUserRole.user,
  5. Client? httpClient,
})

Creates a new client configured for your Comments project.

  • baseUrl should point to the backend root (e.g. https://api.example).
  • apiKey is your project API key used to obtain JWTs.
  • externalUser identifies the current user and is embedded in tokens.
  • role defaults to CommentsUserRole.user for regular usage.
  • httpClient can be provided to reuse an existing HTTP client.

Implementation

CommentsClient({
  required this.baseUrl,
  required this.apiKey,
  required this.externalUser,
  this.role = CommentsUserRole.user,
  http.Client? httpClient,
}) : _http = httpClient ?? http.Client();