fivestar_support 1.0.0 copy "fivestar_support: ^1.0.0" to clipboard
fivestar_support: ^1.0.0 copied to clipboard

Flutter SDK for FiveStar Support - Customer feedback platform. Submit bug reports, feature requests, and gather customer feedback easily.

fivestar_support #

pub package License: MIT

Flutter SDK for FiveStar Support - Customer feedback platform.

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  fivestar_support: ^1.0.0

Then run:

flutter pub get

Features #

  • Customer ID Generation: Generate secure, client-specific customer IDs
  • Feedback Submission: Submit bug reports, feature requests, and general feedback
  • Voting: Upvote/downvote responses
  • Comments: Post comments on feedback items
  • Dart-native: Written in pure Dart with no platform dependencies

Quick Start #

import 'package:fivestar_support/fivestar_support.dart';

// Initialize the client
final client = FiveStarClient(FiveStarClientConfig(
  clientId: 'your-client-uuid', // Get this from your FiveStar dashboard
  apiUrl: 'https://fivestar.support', // Optional, defaults to fivestar.support
));

// Generate a customer ID for your user
final customerId = generateCustomerId(client.clientId);

// Register the customer (recommended on first launch)
await client.registerCustomer(customerId);

// Submit feedback
final types = await client.getResponseTypes();
await client.submitResponse(SubmitResponseOptions(
  title: 'Feature request: Dark mode',
  description: 'Please add a dark mode to the application',
  typeId: types[0].id,
));

Usage #

Initialize the Client #

import 'package:fivestar_support/fivestar_support.dart';

final client = FiveStarClient(FiveStarClientConfig(
  clientId: 'your-client-uuid',
  apiUrl: 'https://fivestar.support', // optional
));

Generate and Register Customer ID #

// Generate a customer ID unique to this client
final customerId = generateCustomerId(client.clientId);

// Register the customer with your app
final result = await client.registerCustomer(
  customerId,
  RegisterCustomerOptions(
    email: 'user@example.com',
    name: 'John Doe',
  ),
);

if (result.success) {
  print('Customer registered: ${result.customer?.id}');
}

Get Response Types #

final types = await client.getResponseTypes();
for (final type in types) {
  print('${type.name}: ${type.id}');
}

Submit Feedback #

final result = await client.submitResponse(SubmitResponseOptions(
  title: 'Feature request',
  description: 'Please add dark mode support',
  typeId: types.first.id,
  email: 'user@example.com',
  name: 'John Doe',
));

if (result.success) {
  print('Response submitted: ${result.responseId}');
}

Vote on a Response #

final result = await client.vote(
  responseId,
  customerId,
  'up', // or 'down'
);

print('Votes: ${result.votesUp} up, ${result.votesDown} down');

Comment on a Response #

final result = await client.comment(
  responseId,
  customerId,
  'This would be very useful!',
);

Get Comments #

final comments = await client.getComments(responseId);
for (final comment in comments.comments) {
  print(comment['content']);
}

Get Public URL #

// Get default public URL
final url = client.getPublicUrl();

// Get localized public URL
final frenchUrl = client.getPublicUrl('fr');

Customer ID Format #

Customer IDs are 26-character strings using the Crockford base32 alphabet. They are encoded using a client-specific XOR cipher to prevent forgery.

  • Format: 26 characters, [0-9A-HJKMNPQRSTVWXYZ]
  • Client-specific: Each client generates unique customer IDs
  • Verifiable: IDs can be verified against a client ID

Validation #

// Check format validity
if (isValidCustomerIdFormat(customerId)) {
  // Verify against client
  final isValid = verifyCustomerId(customerId, clientId);
  print('Valid: $isValid');
}

// Decode to get original ULID
final ulid = decodeCustomerId(customerId, clientId);
print('Original ULID: $ulid');

API Reference #

FiveStarClient #

Main client class for interacting with the FiveStar Support API.

Methods

  • Future<List<ResponseType>> getResponseTypes() - Get all response types
  • Future<SubmitResponseResult> submitResponse(SubmitResponseOptions) - Submit feedback
  • Future<RegisterCustomerResult> registerCustomer(String, [RegisterCustomerOptions?]) - Register customer
  • Future<VerifyCustomerResult> verifyCustomer(String) - Verify customer ID
  • Future<VoteResult> vote(String, String, String) - Vote on response
  • Future<CommentResult> comment(String, String, String) - Post comment
  • Future<CommentsResult> getComments(String) - Get comments
  • String getPublicUrl([String?]) - Get public feedback URL

Customer ID Functions #

  • String generateCustomerId(String) - Generate client-specific customer ID
  • bool verifyCustomerId(String, String) - Verify customer ID for client
  • String? decodeCustomerId(String, String) - Decode customer ID to ULID
  • bool isValidCustomerIdFormat(String) - Validate customer ID format

License #

MIT © Ryan Weber Ltd

Support #

0
likes
0
points
348
downloads

Publisher

verified publisherryan-weber.com

Weekly Downloads

Flutter SDK for FiveStar Support - Customer feedback platform. Submit bug reports, feature requests, and gather customer feedback easily.

Homepage
Repository (GitHub)
View/report issues

Topics

#feedback #support #customer-service #bug-tracking

Documentation

Documentation

License

unknown (license)

Dependencies

flutter, http, ulid

More

Packages that depend on fivestar_support