mirror of
https://github.com/EthanShoeDev/fressh.git
synced 2026-01-10 22:02:50 +00:00
@fressh/react-native-uniffi-russh
React Native bindings (via UniFFI) for the Rust SSH library russh.
Install
pnpm add @fressh/react-native-uniffi-russh
Peer dependencies (you manage): react, react-native.
Usage
This package exposes a native Rust module for SSH transport. For a complete, working integration, see the example app:
API overview
High-level API surface (see code for full types):
import { RnRussh } from '@fressh/react-native-uniffi-russh';
await RnRussh.uniffiInitAsync();
const conn = await RnRussh.connect({
host: 'example.com',
port: 22,
username: 'me',
security: { type: 'password', password: '...' },
onServerKey: async () => true,
});
const shell = await conn.startShell({ term: 'Xterm' });
shell.addListener(
(ev) => {
// handle TerminalChunk or DropNotice
},
{ cursor: { mode: 'live' } },
);
Links
- Changelog:
CHANGELOG.md - Contributing:
CONTRIBUTING.md - API source:
src/api.ts - License: MIT