thunderbird-account-qr-code
v1.1.0
Published
Encode E-Mail account info in a QR code for import in Thunderbird for Android"
Readme
Thunderbird account QR code
Thunderbird for Android allows importing accounts through a QR code. This allows easy transmission of account configuration details. The goal of this library is to help with generating such QR codes by formatting the information as required by the format for Thunderbird for Android.
It does, however, not include any actual QR generation capabilities, you can choose almost any library that can encode an arbitrary string as data. Note that you might have to appropriately encode the string first, so UTF-8 code points are properly transmitted.
This implementation is independent from the one in Thunderbird desktop and might behave differently in some cases.
Installation
The library is published on npm, but it is also self-contained so you can also include index.js in your project directly. Make sure to preserve licensing information.
Usage
To format the data, use the method encodeAccounts and the constants provided by the module. There is fairly thorough JS Doc explaining the usage.
Example
import {
encodeAccounts,
INCOMING_PROTOCOL,
CONNECTION_SECURITY,
AUTHENTICATION_TYPE,
} from "thunderbird-account-qr-code";
const qrInput = encodeAccounts([ {
incomingProtocol: INCOMING_PROTOCOL.IMAP,
incomingHostname: "imap.example.com",
incomingPort: 993,
incomingConnectionSecurity: CONNECTION_SECURITY.Tls,
incomingAuthenticationType: AUTHENTICATION_TYPE.PasswordCleartext,
incomingUsername: "[email protected]",
outgoingHostname: "smtp.example.com",
outgoingPort: 465,
outgoingConnectionSecurity: CONNECTION_SECURITY.Tls,
outgoingAuthenticationType: AUTHENTICATION_TYPE.PasswordCleartext,
outgoingUsername: "[email protected]",
identityEmailAddress: "[email protected]",
identityDisplayName: "Example account config",
} ]);Example usage
You can find the example provided in the example directory hosted at https://lab.humanoids.be/thunderbird-account-qr-code/example.
License
This library is licensed under the MIT License.
