Skip to content

ae1dev/flutter_featurebase

Repository files navigation

Featurebase (Unofficial) Flutter SDK

Featurebase is a Feedback, Help center, Changelog and Survey hub. Learn more at https://featurebase.app

📋 Features

  • Feedback - ⚠️ Only for users using SSO login ⚠️
  • Help center
  • Changelog
  • Surveys (Planned)

📱🖥️ Platform Support

Android iOS MacOS Web Linux Windows

🚀 Get started

First you need to add the package to your pubspec.yaml file.

Then add the FeaturebaseLocalizations delegate to your MaterialApp for the packages localization.

localizationsDelegates: [
    FeaturebaseLocalizations.delegate,
    //Any other delegates
],

Then you can use one of the supported modules.

💬 Feedback

To use the feedback page, you must be using SSO login for your Featurebase organization.

Setup SSO Auth

For the SSO auth you will need to create a GET endpoint that the SDK can call out to to get the JWT for Featurebase. You can read this article on how to create a JWT token for Featurebase.

When launching the feedback page you will need to provide an authoration token (that will be passed in the Authorization header field) that works on your endpoint and an endpoint url.

openFeedbackPage(
  //...
  ssoAuthToken: "Bearer mytoken123",
  ssoTokenUrl: "https://api.example.com/v1/auth/featurebase/token",
  //...
);

The GET endpoint that you setup should return the data formated like the example below for the SDK to read.

{
    "data": {
        "token": "the-jwt-token-string"
    }
}

Open Feedback page

Call the openFeedbackPage function to open the feedback page.

openFeedbackPage(
    logo: SvgPicture.asset(
        'assets/logo.svg',
        height: 25,
        width: 25,
        colorFilter: const ColorFilter.mode(
            Colors.white,
            BlendMode.srcIn,
        ),
    ),
    ssoAuthToken: 'Bearer mytoken123',
    ssoTokenUrl:'https://api.example.com/v1/auth/featurebase/token',
    appName: 'Featurebase',
    organizationName: 'exampleOrg',
    primaryColor: Theme.of(context).primaryColor,
    textColor: Colors.white,
    backgroundColor: Theme.of(context).scaffoldBackgroundColor,
    defaultLocale: Locale('en'),
    context: context,
);

📖 Help Center

Call the openHelpCenter function to open the help center panel.

openHelpCenter(
    logo: SvgPicture.asset(
        'assets/logo.svg',
        height: 25,
        width: 25,
        colorFilter: const ColorFilter.mode(
            Colors.white,
            BlendMode.srcIn,
        ),
    ),
    organizationName: 'feedback', // This is the Featurebase organization name
    primaryColor: Theme.of(context).primaryColor,
    textColor: Colors.white,
    backgroundColor: Theme.of(context).scaffoldBackgroundColor,
    context: context,
);

Example:

Example Image

📣 Changelog

Call the openChangelog function to open the changelog page.

openChangelog(
    logo: SvgPicture.asset(
        'assets/logo.svg',
        height: 25,
        width: 25,
        colorFilter: const ColorFilter.mode(
            Colors.white,
            BlendMode.srcIn,
        ),
    ),
    organizationName: 'feedback', // This is the Featurebase organization name
    primaryColor: Theme.of(context).primaryColor,
    textColor: Colors.white,
    backgroundColor: Theme.of(context).scaffoldBackgroundColor,
    context: context,
);

Example:

Example Image

🌐 Localization

Supported languages:

  • Afrikaans
  • Arabic
  • Azerbaijani
  • Belarusian
  • Bulgarian
  • Tibetan
  • Catalan
  • Czech
  • Danish
  • German
  • German (Switzerland)
  • Greek
  • English
  • Spanish (Spain)
  • Spanish (Latin America)
  • Persian
  • Finnish
  • French
  • Galician
  • Hindi
  • Hungarian
  • Indonesian
  • Icelandic
  • Italian
  • Japanese
  • Korean
  • Lithuanian
  • Latvian
  • Malay
  • Norwegian Bokmal
  • Dutch (@stijnvdkolk)
  • Polish
  • Portuguese (Brazil)
  • Romanian
  • Russian
  • Slovak
  • Slovene
  • Serbian
  • Swedish
  • Swahili
  • Tahi
  • Turkish
  • Ukrainian
  • Vietnamese
  • Chinese (Simplified)
  • Chinese (Traditional)
  • Chinese (Traditional - Taiwan)

👨‍💻 Contribution

Please file an issue if you find an issue or you can make a pull request.