- Local Communication: Direct peer-to-peer within Bluetooth range
- Multi-hop Relay: Messages route through nearby devices (max 7 hops)
- No Internet Required: Works completely offline in disaster scenarios
- Noise Protocol Encryption: End-to-end encryption with forward secrecy
- Binary Protocol: Compact packet format optimized for Bluetooth LE constraints
- Automatic Discovery: Peer discovery and connection management
- Adaptive Power: Battery-optimized duty cycling
https://github.com/permissionlesstech/bitchat https://github.com/permissionlesstech/bitchat-android
npm install @capacitor-trancee/bitchat
npx cap syncThese configuration values are available:
| Prop | Type | Description | Default | Since |
|---|---|---|---|---|
announceInterval |
number |
Sets the interval (in milliseconds) for announcing presence to nearby peers. | 30000 (30 seconds) |
0.1.4 |
In capacitor.config.json:
{
"plugins": {
"Bitchat": {
"announceInterval": 10000
}
}
}In capacitor.config.ts:
/// <reference types="@capacitor-trancee/bitchat" />
import { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
plugins: {
Bitchat: {
announceInterval: 10000,
},
},
};
export default config;initialize(...)isInitialized()start(...)isStarted()stop()establish(...)isEstablished(...)send(...)checkPermissions()requestPermissions(...)addListener('onStarted', ...)addListener('onStopped', ...)addListener('onFound', ...)addListener('onLost', ...)addListener('onConnected', ...)addListener('onDisconnected', ...)addListener('onEstablished', ...)addListener('onSent', ...)addListener('onReceived', ...)addListener('onPeerListUpdated', ...)addListener('onPeerIDChanged', ...)addListener('onRSSIUpdated', ...)removeAllListeners()- Interfaces
- Type Aliases
initialize(options?: InitializeOptions | undefined) => Promise<InitializeResult>| Param | Type |
|---|---|
options |
InitializeOptions |
Returns: Promise<InitializeResult>
isInitialized() => Promise<IsInitializedResult>Returns: Promise<IsInitializedResult>
start(options?: StartOptions | undefined) => Promise<StartResult>| Param | Type |
|---|---|
options |
StartOptions |
Returns: Promise<StartResult>
isStarted() => Promise<IsStartedResult>Returns: Promise<IsStartedResult>
stop() => Promise<void>establish(options?: EstablishOptions | undefined) => Promise<EstablishResult>| Param | Type |
|---|---|
options |
EstablishOptions |
Returns: Promise<EstablishResult>
isEstablished(options?: IsEstablishedOptions | undefined) => Promise<IsEstablishedResult>| Param | Type |
|---|---|
options |
IsEstablishedOptions |
Returns: Promise<IsEstablishedResult>
send(options: SendOptions) => Promise<SendResult>| Param | Type |
|---|---|
options |
SendOptions |
Returns: Promise<SendResult>
checkPermissions() => Promise<PermissionStatus>Returns: Promise<PermissionStatus>
requestPermissions(options?: Permissions | undefined) => Promise<PermissionStatus>| Param | Type |
|---|---|
options |
Permissions |
Returns: Promise<PermissionStatus>
addListener(eventName: 'onStarted', listenerFunc: OnStartedListener) => Promise<PluginListenerHandle>| Param | Type |
|---|---|
eventName |
'onStarted' |
listenerFunc |
OnStartedListener |
Returns: Promise<PluginListenerHandle>
addListener(eventName: 'onStopped', listenerFunc: OnStoppedListener) => Promise<PluginListenerHandle>| Param | Type |
|---|---|
eventName |
'onStopped' |
listenerFunc |
OnStoppedListener |
Returns: Promise<PluginListenerHandle>
addListener(eventName: 'onFound', listenerFunc: OnFoundListener) => Promise<PluginListenerHandle>| Param | Type |
|---|---|
eventName |
'onFound' |
listenerFunc |
OnFoundListener |
Returns: Promise<PluginListenerHandle>
Since: 0.1.3
addListener(eventName: 'onLost', listenerFunc: OnLostListener) => Promise<PluginListenerHandle>| Param | Type |
|---|---|
eventName |
'onLost' |
listenerFunc |
OnLostListener |
Returns: Promise<PluginListenerHandle>
Since: 0.1.3
addListener(eventName: 'onConnected', listenerFunc: OnConnectedListener) => Promise<PluginListenerHandle>| Param | Type |
|---|---|
eventName |
'onConnected' |
listenerFunc |
OnConnectedListener |
Returns: Promise<PluginListenerHandle>
addListener(eventName: 'onDisconnected', listenerFunc: OnDisconnectedListener) => Promise<PluginListenerHandle>| Param | Type |
|---|---|
eventName |
'onDisconnected' |
listenerFunc |
OnDisconnectedListener |
Returns: Promise<PluginListenerHandle>
addListener(eventName: 'onEstablished', listenerFunc: OnEstablishedListener) => Promise<PluginListenerHandle>| Param | Type |
|---|---|
eventName |
'onEstablished' |
listenerFunc |
OnEstablishedListener |
Returns: Promise<PluginListenerHandle>
Since: 0.1.5
addListener(eventName: 'onSent', listenerFunc: OnSentListener) => Promise<PluginListenerHandle>| Param | Type |
|---|---|
eventName |
'onSent' |
listenerFunc |
OnSentListener |
Returns: Promise<PluginListenerHandle>
addListener(eventName: 'onReceived', listenerFunc: OnReceivedListener) => Promise<PluginListenerHandle>| Param | Type |
|---|---|
eventName |
'onReceived' |
listenerFunc |
OnReceivedListener |
Returns: Promise<PluginListenerHandle>
addListener(eventName: 'onPeerListUpdated', listenerFunc: OnPeerListUpdatedListener) => Promise<PluginListenerHandle>| Param | Type |
|---|---|
eventName |
'onPeerListUpdated' |
listenerFunc |
OnPeerListUpdatedListener |
Returns: Promise<PluginListenerHandle>
addListener(eventName: 'onPeerIDChanged', listenerFunc: OnPeerIDChangedListener) => Promise<PluginListenerHandle>| Param | Type |
|---|---|
eventName |
'onPeerIDChanged' |
listenerFunc |
OnPeerIDChangedListener |
Returns: Promise<PluginListenerHandle>
Since: 0.1.4
addListener(eventName: 'onRSSIUpdated', listenerFunc: OnRSSIUpdatedListener) => Promise<PluginListenerHandle>| Param | Type |
|---|---|
eventName |
'onRSSIUpdated' |
listenerFunc |
OnRSSIUpdatedListener |
Returns: Promise<PluginListenerHandle>
removeAllListeners() => Promise<void>| Prop | Type | Since |
|---|---|---|
peerID |
PeerID |
0.1.1 |
| Prop | Type | Default | Since |
|---|---|---|---|
announceInterval |
number |
10000 (10 seconds) |
0.1.4 |
| Prop | Type |
|---|---|
isInitialized |
boolean |
| Prop | Type | Since |
|---|---|---|
peerID |
PeerID |
0.1.1 |
| Prop | Type | Since |
|---|---|---|
message |
Base64 |
0.1.1 |
| Prop | Type |
|---|---|
isStarted |
boolean |
| Prop | Type | Since |
|---|---|---|
isEstablished |
boolean |
0.1.5 |
| Prop | Type | Since |
|---|---|---|
peerID |
PeerID |
0.1.5 |
| Prop | Type | Since |
|---|---|---|
isEstablished |
boolean |
0.1.5 |
| Prop | Type | Since |
|---|---|---|
peerID |
PeerID |
0.1.5 |
| Prop | Type |
|---|---|
messageID |
MessageID |
| Prop | Type |
|---|---|
message |
Base64 |
peerID |
PeerID |
| Prop | Type | Description | Since |
|---|---|---|---|
bluetooth |
PermissionState |
BLUETOOTH_ADVERTISE Required to be able to advertise to nearby Bluetooth devices. BLUETOOTH_CONNECT Required to be able to connect to paired Bluetooth devices. BLUETOOTH_SCAN Required to be able to discover and pair nearby Bluetooth devices. BLUETOOTH Allows applications to connect to paired bluetooth devices. BLUETOOTH_ADMIN Allows applications to discover and pair bluetooth devices. |
0.1.0 |
location |
PermissionState |
ACCESS_FINE_LOCATION Allows an app to access precise location. ACCESS_COARSE_LOCATION Allows an app to access approximate location. |
0.1.0 |
battery |
PermissionState |
REQUEST_IGNORE_BATTERY_OPTIMIZATIONS Allows an app to ignore battery optimizations. |
0.1.0 |
| Prop | Type |
|---|---|
permissions |
PermissionType[] |
| Prop | Type |
|---|---|
remove |
() => Promise<void> |
| Prop | Type | Since |
|---|---|---|
peerID |
PeerID |
0.1.0 |
isStarted |
boolean |
0.1.1 |
| Prop | Type | Since |
|---|---|---|
peerID |
PeerID |
|
message |
Base64 |
0.1.5 |
| Prop | Type |
|---|---|
peerID |
PeerID |
| Prop | Type |
|---|---|
peerID |
PeerID |
| Prop | Type |
|---|---|
peerID |
PeerID |
| Prop | Type | Since |
|---|---|---|
peerID |
PeerID |
0.1.5 |
| Prop | Type | Since |
|---|---|---|
messageID |
MessageID |
|
peerID |
PeerID |
0.1.2 |
| Prop | Type |
|---|---|
messageID |
MessageID |
message |
Base64 |
peerID |
PeerID |
| Prop | Type | Since |
|---|---|---|
peers |
ID[] |
0.1.1 |
| Prop | Type | Since |
|---|---|---|
peerID |
PeerID |
0.1.4 |
oldPeerID |
PeerID |
0.1.5 |
message |
Base64 |
| Prop | Type |
|---|---|
peerID |
PeerID |
rssi |
number |
string & { readonly __brand: unique symbol }
string & { readonly __brand: unique symbol }
string & { readonly __brand: unique symbol }
'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'
'bluetooth' | 'location' | 'battery'
(event: OnStartedEvent): void
(event: void): void
(event: OnFoundEvent): void
(event: OnLostEvent): void
(event: OnConnectedEvent): void
(event: OnDisconnectedEvent): void
(event: OnEstablishedEvent): void
(event: OnSentEvent): void
(event: OnReceivedEvent): void
(event: OnPeerListUpdatedEvent): void
(event: OnPeerIDChangedEvent): void
(event: OnRSSIUpdatedEvent): void