Files
fressh/packages/react-native-uniffi-russh/README.md
EthanShoeDev e4139c6f7b small tweaks
2025-10-07 10:19:45 -04:00

1.5 KiB

@fressh/react-native-uniffi-russh

React Native bindings (via UniFFI) for the Rust SSH library russh.

npm version

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' } },
);