CommentsClient constructor
CommentsClient({
- required String baseUrl,
- required String apiKey,
- required CommentsExternalUser externalUser,
- CommentsUserRole role = CommentsUserRole.user,
- Client? httpClient,
Creates a new client configured for your Comments project.
baseUrlshould point to the backend root (e.g.https://api.example).apiKeyis your project API key used to obtain JWTs.externalUseridentifies the current user and is embedded in tokens.roleis kept for API compatibility but is ignored: permissions are derived server-side from the API key and never from the client.httpClientcan 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();