Thanks for your interest in contributing to the Crisp Chat Flutter Package! Your contributions help improve the experience for everyone using this package. Please take a moment to review this guide before getting started.
To run and work on this project locally, follow these steps:
- Click the Fork button in the top-right corner of the repository page.
- Clone your forked repository to your local machine:
git clone https://github.com/alamin-karno/flutter-crisp-chat
cd flutter_crisp_chatThe example folder contains a Flutter project to test the Crisp Chat plugin.
You’ll need to add some secrets and configurations to run it properly:
To run this project, you need to add your Firebase configuration files:
android/app/google-services.jsonios/Runner/GoogleService-Info.plist
These files are not included in this repo for security reasons.
-
Create a new Firebase project at Firebase Console.
-
Add an iOS app and an Android app (optional) and get the Firebase auto setup.
If not then follow below steps. -
Download the
GoogleService-Info.plistfile for iOS and place it in:
example/ios/Runner/GoogleService-Info.plist- Download the
google-services.jsonfile for Android and place it in:
example/android/app/google-services.jsonYou may also need to enable Firebase Cloud Messaging if you want to test push notifications.
-
First, you need to create a Crisp account and set up a website.
-
You can get your Website ID from your Crisp Dashboard.
-
Then, create a
config.jsonfile in theexample/lib/directory to store your Crisp Website ID. -
In the
example/lib/config.jsonprovide your Crisp Website ID:{ "websiteId": "PUT_YOUR_WEBSITE_ID_HERE", "identifier": "YOUR_CRISP_API_IDENTIFIER", "crispApiKey": "YOUR_CRISP_API_KEY" } -
For every request that you make to
getUnreadMessageCount, you must submit your authentication token (identifierandkey), as well as yourwebsite_id.-
Obtaining
Identifier&Key:- Head over to the Crisp Marketplace
- Sign in or create an account (this account is different from your main Crisp account)
- Once logged-in, go to Plugins and click on the New Plugin button
- Select the plugin type, in this case Private
- Name your plugin a name, eg. "My First Crisp Plugin", and hit Create
- On the plugin tab, go to Tokens and scroll down to Development Token to view (and manage) your token
identifier/keypair - Obtaining a production token is the next natural step once you are ready to step into production with your plugin or if your usage requires higher quotas.
-
Before using your development token, you now need to associate your marketplace account to your Crisp workspace. This is done by specifying a Trusted Workspace:
- Go to the Settings of your Crisp Marketplace account
- Click on Add Trusted Workspace and submit your
website_id - Enter the credentials of your main Crisp account (the ones you use to access your main Crisp account) and then submit your 2FA token (if any is enabled)
- You're all done! You are now ready to use REST API and start building your plugin
-
-
Then, run your project:
flutter run --dart-define-from-file=config.json
or, you can add --dart-define-from-file=config.json on Android Studio or VSCode run configurations.
-
Open an Issue
- Describe what you want to fix or add.
- Explain your motivation or expected outcome.
-
Create a Feature Branch
- Always base your changes on a specific issue.
- Use a clear naming convention:
git checkout -b fix/issue-23-fix-push-notification
-
Make Your Changes
- Follow the coding style already present in the plugin.
- Keep commits atomic and descriptive.
- If you’re changing native code, test it in the
exampleapp.
-
Push & Open a Pull Request (PR)
- Push your branch:
git push origin fix/issue-23-fix-push-notification
- Open a pull request on GitHub, referencing the issue number in the description.
- Use meaningful commit messages. Example:
fix(iOS): handle missing deviceToken crash on launch- Always test your code using the example project.
- If your change includes a fix or feature, update the README.md if needed.
If you’re unsure about something, feel free to:
- Create a GitHub Discussion or Issue
- Message the maintainer for clarification We’re happy to help you get started!
Thank you for contributing! 🙌