{"id":3831,"url":"https://github.com/bugfender/cordova-plugin-bugfender","last_synced_at":"2025-04-26T11:31:55.188Z","repository":{"id":10929541,"uuid":"65020339","full_name":"bugfender/cordova-plugin-bugfender","owner":"bugfender","description":"Bugfender support for Cordova applications under iOS and Android","archived":false,"fork":false,"pushed_at":"2024-09-09T10:28:36.000Z","size":122,"stargazers_count":8,"open_issues_count":1,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-09-09T12:33:18.019Z","etag":null,"topics":["android","bugfender","cordova","cordova-plugin","ios","phonegap"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bugfender.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-08-05T13:25:25.000Z","updated_at":"2024-09-09T10:27:49.000Z","dependencies_parsed_at":"2024-01-02T20:53:41.348Z","dependency_job_id":null,"html_url":"https://github.com/bugfender/cordova-plugin-bugfender","commit_stats":{"total_commits":42,"total_committers":6,"mean_commits":7.0,"dds":0.5,"last_synced_commit":"bc5af69ae7ea6969d34c5a058c94e33730afccdf"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugfender%2Fcordova-plugin-bugfender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugfender%2Fcordova-plugin-bugfender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugfender%2Fcordova-plugin-bugfender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugfender%2Fcordova-plugin-bugfender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bugfender","download_url":"https://codeload.github.com/bugfender/cordova-plugin-bugfender/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224032184,"owners_count":17244373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","bugfender","cordova","cordova-plugin","ios","phonegap"],"created_at":"2024-01-05T20:16:52.760Z","updated_at":"2024-11-11T01:15:41.002Z","avatar_url":"https://github.com/bugfender.png","language":"JavaScript","readme":"# cordova-plugin-bugfender\n\n\u003e ⚠️ **NOTE:** If you're starting a new project we recomend you to use [Capacitor](https://capacitorjs.com/) with it's corresponding [Bugfender SDK](https://github.com/bugfender/bugfender-web-capacitor).\n\nThis plugin adds Bugfender support for Cordova applications under iOS and Android. Also works on Cordova-based projects such as Phonegap and Ionic.\n\n## Requirements\nYou will need Cordova 9, Ionic 4 or a newer.\n\nFor iOS, you will need macOS and [CocoaPods](http://cocoapods.org/) installed on your system. iOS deployment target version is required to be 10.0 at least.\n\nYou can set the minimum version by adding this preference to the `\u003cplatform name=\"ios\"\u003e` tag in your `config.xml`:\n\n```\n \u003cpreference name=\"deployment-target\" value=\"10.0\" /\u003e\n```\n\nYou will also need to update your Cocoapods specs, otherwise the installation might fail:\n\n```\npod repo update\n```\n\n## Installing in Cordova\nIn the command line, run (replace `XXX` with your app key):\n\n```\ncordova plugin add cordova-plugin-bugfender --variable BUGFENDER_APP_KEY=XXX --variable BUGFENDER_AUTOMATIC=UI,CRASH --save\n```\n\n**If using TypeScript:** you also need to declare the Bugfender global variable in the files where you need it:\n\n```\ndeclare var Bugfender: any;\n```\n\nThen use `Bugfender.log()` to log anything you want. Syntax is the same as `console.log()`.\n\nFor a basic use of Bugfender, that's all you need to do. Read on to learn more advanced options.\n\n## Installing in Ionic\nIn the command line, run (replace `XXX` with your app key):\n\n```\nionic cordova plugin add cordova-plugin-bugfender --variable BUGFENDER_APP_KEY=XXX --save\n```\n\nWherever you want to use Bugfender, import it:\n\n```\nimport { Bugfender } from 'cordova-plugin-bugfender/www/bugfender';\n```\n\nThen use `Bugfender.log()` to log anything you want. Syntax is the same as `console.log()`.\n\nFor a basic use of Bugfender, that's all you need to do. Read on to learn more advanced options.\n\n## Configuration variables\n\n### Application key\nThe `BUGFENDER_APP_KEY` variable idicates the Bugfender application to log to. You can get one at [bugfender.com](https://bugfender.com).\n\n### Automated logger configuration (optional)\nThe `BUGFENDER_AUTOMATIC` variable is a comma separated set of the following values:\n\n* `NONE`: no logging is done automatically. Only logs you manually send via the `log`, `fatal`, `error`, `warn`, `info`, `debug` and `trace` methods are sent to the server.\n* `UI`: user interaction and screen changes are logged automatically. Please note only interactions with native elements will be logged.\n* `CRASH`: crashes are logged automatically.\n* `LOG`: (Android only) anything logged to Logcat is fetched and sent automatically. This might include log messages generated by the system or libraries in your project.\n* `ALL`: all automated loggers are enabled. As of today, this is equivalent to `UI,LOG,CRASH`, but more loggers could be included in the future. This enables all of them.\n\nYou can specify this variable when installing the plugin as a `--variable`, for example `cordova plugin add cordova-plugin-bugfender --variable BUGFENDER_APP_KEY=XXX --variable BUGFENDER_AUTOMATIC=NONE --save`.\n\n### Base URLs (optional)\nIf you have your own Bugfender instance, you will need to set `BUGFENDER_API_URL` and `BUGFENDER_BASE_URL` according to the provided instructions.\n\n### Hide device name\nThe `BUGFENDER_HIDE_DEVICE_NAME` enables hiding the device name if you do not want to collect it automatically. Set it to any value, for example `--variable BUGFENDER_HIDE_DEVICE_NAME=YES`.\n\n## Reference\n\n### Manual logging\nYou can use Bugfender in a similar way you would use the `console` object.\n\nYou can log strings, numbers or booleans:\n\n```\nBugfender.log('Hello! This is three:', 3, 'And this is true:', true);\n```\n\nYou can log objects, they will be converted to a JSON string:\n\n```\nBugfender.log('Current score:', {user: 'John', points: 100});\n```\n\nYou can specify a format argument as first parameter:\n\n```\nBugfender.log(\"%s has %d points\", \"Sam\", 100);\n```\n\nFormat arguments available are as follows:\n\n| Substitution string | Description |\n| ---- | ---- |\n| %o or %O | Outputs a JavaScript object which will be serialized as JSON |\n| %d or %i | Outputs an integer. Number formatting is supported, for example  console.log(\"Foo %.2d\", 1.1) will output the number as two significant figures with a leading 0: Foo 01 |\n| %s | Outputs a string. |\n| %f | Outputs a floating-point value. Formatting is supported, for example  console.log(\"Foo %.2f\", 1.1) will output the number to 2 decimal places: Foo 1.10 |\n\nThe following logging levels are available:\n\n* `fatal([fmt,] message,...)`\n* `error([fmt,] message,...)`\n* `warn([fmt,] message,...)`\n* `info([fmt,] message,...)`\n* `debug([fmt,] message,...)`\n* `trace([fmt,] message,...)`\n* `log([fmt,] message,...)` (equivalent to `debug`)\n\n### Device associated data\nUsing these functions you can associate key-value pairs to a device, like a dictionary.\n\n* `setDeviceKey(key, value)`: sets a key-value pair. You can set strings, numbers or booleans\n* `removeDeviceKey(key)`: removes a key-value pair\n\nFor example:\n\n```\n// when user logs in\nBugfender.setDeviceKey('email', 'test@example.com');\n...\n// when user logs out\nBugfender.removeDeviceKey('email');\n```\n\n### Send logs programatically\nYou can override the Bugfender website settings with the following functions.\n\n* `sendIssue(title,text)`: Sends an issue. Sending an issue forces the logs of the current session being sent to the server, and marks the session so that it is highlighted in the web console. The `text` parameter is interpreted as Markdown.\n* `forceSendOnce`: Synchronizes all logs with the server once, regardless if this device is enabled or not. This method is useful when an error condition is detected and the logs should be sent to the server for analysis, regardless if the device is enabled in the Bugfender Console. Logs are synchronized only once. After that, the logs are again sent according to the enabled flag in the Bugfender Console. This command can be called anytime, and will take effect the next time the device is online.\n* `setForceEnabled(enabled)`: Synchronizes all logs with the server all the time, regardless if this device is enabled or not. This method is useful when the logs should be sent to the server regardless if the device is enabled in the Bugfender Console. Logs are synchronized continuously while `setForceEnabled` is `true`. This command can be called anytime, and will take effect the next time the device is online.\n\n### Device identifier\nWhen using Bugfender for the first time, a device identifier is generated. The device identifier is unique to the device and installation. It is not related to the device in any way (UDID, MAC address, Android ID, ...). Uninstalling and installing the application again will generate a new device identifier.\n\n* `getDeviceIdentifier(callback)`: Gets the Bugfender internal device identifier. The result is provided in a callback function, the only argument being a string.\n\nFor example:\n\n```\nBugfender.getDeviceIdentifier(function(deviceId){\n\talert(\"Bugfender device id: \" + deviceId);\n});\n```\n\n### Disk usage\nBugfender caches logs in the mobile device internal memory temporarily if there is no Internet connection to send logs. There is the possibility to limit the amount of disk space that this cache can take. If the cache becomes full, the oldest logs will be discarded.\n\n* `setMaximumLocalStorageSize(size)`: Set the maximum space available to store local logs. This value is represented in bytes. There’s a limit of 50 MB. By default it's configured to 5 MB.\n\nFor example:\n\n```\n// set cache size limit to 10 MB\nBugfender.setMaximumLocalStorageSize(10*1024*1024);\n```\n","funding_links":[],"categories":["Tools"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugfender%2Fcordova-plugin-bugfender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbugfender%2Fcordova-plugin-bugfender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugfender%2Fcordova-plugin-bugfender/lists"}