@cetapod/react-native-smb
v1.0.2
Published
SMB client for React Native — simply access, manage, and transfer files across network shares.
Maintainers
Readme
@cetapod/react-native-smb
SMB client for React Native via libsmb2 and Nitro Modules.
Features
- SMBv2/v3
SmbTaskper operation —result(),subscribe(),cancel()- 4-slot connection pool, interactive-priority slot 0
- 8-chunk pipelining per connection
SmbError/SmbTaskError, React hooks
Compatibility
| | | | -------------------------- | -------------- | | React Native | >= 0.76 | | React | >= 19 | | react-native-nitro-modules | >= 0.22, < 1.0 | | iOS | 12+ | | Android | not yet |
Install
npm install @cetapod/react-native-smb react-native-nitro-modules
cd ios && pod installQuick start
import { SMB, type SmbCredentials } from '@cetapod/react-native-smb';
const smb = SMB();
const creds: SmbCredentials = { username: 'user', password: 'pass' };
await smb.connect('smb://192.168.1.100/Media', creds).result();
const entries = await smb.listDirectory('/', false).result();
const task = smb.downloadFile('/video.mp4', '/local/video.mp4');
task.subscribe((snap) => console.log(snap.progress));
await task.result();URL: smb://[<domain;][<user>@]<host>[:<port>]/<share>/<path>
Documentation
| | | | ----------------------------------------- | ------------------------------------------------- | | Task model | Subscribe, fire-and-forget, transfer tray, errors | | API reference | Methods, types, hooks, utilities | | Connection pool | Slots, chunk pipeline, multichannel | | Example app | Running the Expo demo |
Example app
npm run exampleSee example/README.md.
License
LGPL-2.1 — same family as libsmb2. See LICENSE.
