npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@speedshield/react-native-ssh-sftp

v3.0.1

Published

SSH and SFTP client library for React Native

Readme

SSH and SFTP client library for React Native

SSH and SFTP client library for React Native on iOS and Android.

Compile package Release

Installation

npm install @speedshield/react-native-ssh-sftp

iOS

No Podfile edits are needed. The iOS side is backed by Citadel, a pure-Swift SSH/SFTP library, vendored as a precompiled XCFramework and wired up through RNSSHClient.podspec, which CocoaPods and Expo's autolinking resolve automatically like any other autolinked native dependency.

Just run pod install in your ./ios directory after installing the package, same as you would for any other native module:

cd ios
pod install
cd -

[!TIP] Adding a postinstall script to your package.json file to run pod install after npm install is a good idea. The pod-install package is a good way to do this.

{
  "scripts": {
    "postinstall": "npx pod-install"
  }
}

[!NOTE] This library requires iOS 18.0 or later, needed for the Swift concurrency APIs (SE-0417) that the Citadel-based connection handling relies on. tvOS is not supported.

Android

No additional steps are needed for Android.

Linking

This library autolinks via the Expo Modules API, so manual linking is not required in either setup:

Usage

All functions that run asynchronously where we have to wait for a result returns Promises that can reject if an error occurred.

[!NOTE] On the old NMSSH-based iOS implementation, the Simulator only worked with the x86_64 (Intel/Rosetta) Simulator, not the native arm64 Simulator on Apple Silicon Macs - NMSSH didn't ship a universal Simulator slice, so you'd need to explicitly select or force an x86_64 Simulator target (see this issue for background). The Citadel-based rewrite's XCFramework does ship a genuine universal Simulator slice (arm64 + x86_64, verified in its Info.plist), so this specific limitation shouldn't apply anymore - but that's link-level evidence, not a full functional test, so a physical device is still the safer choice until someone confirms a real SSH connection end-to-end on the Simulator.

Create a client using password authentication

import SSHClient from '@speedshield/react-native-ssh-sftp';

SSHClient.connectWithPassword(
  "10.0.0.10",
  22,
  "user",
  "password"
).then(client => {/*...*/});

Create a client using public key authentication

import SSHClient from '@speedshield/react-native-ssh-sftp';

SSHClient.connectWithKey(
  "10.0.0.10",
  22,
  "user",
  privateKey="-----BEGIN RSA...",
  passphrase
).then(client => {/*...*/});

Public key authentication is also supported

{privateKey: '-----BEGIN RSA......'}
{privateKey: '-----BEGIN RSA......', publicKey: 'ssh-rsa AAAAB3NzaC1yc2EA......'}
{privateKey: '-----BEGIN RSA......', publicKey: 'ssh-rsa AAAAB3NzaC1yc2EA......', passphrase: 'Password'}

Close client

client.disconnect();

Execute SSH command

const command = 'ls -l';
client.execute(command)
  .then(output => console.warn(output));

Shell

Start shell

  • Supported ptyType: vanilla, vt100, vt102, vt220, ansi, xterm
const ptyType = 'vanilla';
client.startShell(ptyType)
  .then(() => {/*...*/});

Read from shell

client.on('Shell', (event) => {
  if (event)
    console.warn(event);
});

Write to shell

const str = 'ls -l\n';
client.writeToShell(str)
  .then(() => {/*...*/});

Close shell

client.closeShell();

SFTP

Connect SFTP

client.connectSFTP()
  .then(() => {/*...*/});

List directory

const path = '.';
client.sftpLs(path)
  .then(response => console.warn(response));

Create directory

client.sftpMkdir('dirName')
  .then(() => {/*...*/});

Rename file or directory

client.sftpRename('oldName', 'newName')
  .then(() => {/*...*/});

Remove directory

client.sftpRmdir('dirName')
  .then(() => {/*...*/});

Remove file

client.sftpRm('fileName')
  .then(() => {/*...*/});

Download file

client.sftpDownload('[path-to-remote-file]', '[path-to-local-directory]')
  .then(downloadedFilePath => {
    console.warn(downloadedFilePath);
  });

// Download progress (setup before call)
client.on('DownloadProgress', (event) => {
  console.warn(event);
});

// Cancel download
client.sftpCancelDownload();

Upload file

client.sftpUpload('[path-to-local-file]', '[path-to-remote-directory]')
  .then(() => {/*...*/});

// Upload progress (setup before call)
client.on('UploadProgress', (event) => {
  console.warn(event);
});

// Cancel upload
client.sftpCancelUpload();

Close SFTP

client.disconnectSFTP();

Example app

You can find a very simple example app for the usage of this library here (predates the Expo Modules/Citadel rewrite, so treat it as a usage reference rather than a setup reference).

longphung/rnssh-test-app is a minimal manual test harness kept up to date against this library's current architecture, including the file: sibling-directory setup this repo's own native code needs for local development.

Credits

This package wraps the following libraries, which provide the actual SSH/SFTP functionality:

This package is a fork of Emmanuel Natividad's react-native-ssh-sftp package. The fork chain from there is as follows:

  1. Gabriel Paul "Cley Faye" Risterucci
  2. Bishoy Mikhael
  3. Qian Sha