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.roledefaults to CommentsUserRole.user for regular usage.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();