Client Libraries β
Choose the Sharokey client library that best fits your development stack. All libraries provide Zero Knowledge encryption and are designed to be developer-friendly.
π― Quick Comparison β
| Library | Best For | Key Features |
|---|---|---|
| CLI C# | Shell scripts, CI/CD, automation | Cross-platform executable, pipe support |
| JavaScript SDK | Node.js apps, complex web projects | Full feature set, npm package, TypeScript support |
| JavaScript CDN | Quick browser integration, simple projects | Single file, no build required, plug-and-play |
| Python SDK | Python apps, data science, ML | Async/await, CLI-consistent API |
π¦ Installation β
bash
# Download latest release
curl -L https://github.com/sharokey/cli/releases/latest/download/sharokey.exe -o sharokey.exe
# Or via package manager
winget install Sharokey.CLIbash
npm install sharokey-client
# or
yarn add sharokey-clienthtml
<!-- Direct script include -->
<script src="https://cdn.sharokey.com/js/sharokey.js"></script>
<!-- Or download locally -->
<script src="/js/sharokey.js"></script>bash
pip install sharokey
# or
poetry add sharokeyβ‘ Quick Start Examples β
Create a Secret β
bash
sharokey create "My secret password" --hours 24 --views 1javascript
import { SharokeyClient } from 'sharokey-client';
const client = new SharokeyClient({ token: 'your-token' });
const secret = await client.createSecret('My secret password', {
expirationHours: 24,
maximumViews: 1
});
console.log(secret.shareUrl);javascript
// Available globally after script include
Sharokey.config({ token: 'your-token' });
const secret = await Sharokey.create('My secret password', 24, 1);
console.log(secret.share_url);python
import sharokey
client = sharokey.SharokeyClient(token='your-token')
secret = await client.create('My secret password', 24, 1)
print(secret.share_url)With File Attachments β
bash
sharokey create "Confidential docs" --hours 48 --views 3 \
--attach contract.pdf --attach specs.docxjavascript
const secret = await client.createSecret('Confidential docs', {
expirationHours: 48,
maximumViews: 3,
attachments: [
{ name: 'contract.pdf', data: contractBuffer },
{ name: 'specs.docx', data: specsBuffer }
]
});javascript
const secret = await Sharokey.create('Confidential docs', 48, 3, {
attachments: [contractFile, specsFile] // File objects
});python
secret = await client.create(
'Confidential docs', 48, 3,
attachments=['contract.pdf', 'specs.docx']
)π Security Features β
All libraries implement the same Zero Knowledge encryption:
- AES-GCM-256 encryption
- PBKDF2 key derivation (10,000 iterations)
- Client-side encryption - your data never leaves your device unencrypted
- Two-key system - KeyA (server) + KeyB (share URL fragment)
- Perfect Forward Secrecy - each secret uses unique encryption keys
π Feature Matrix β
| Feature | CLI C# | JS Complete | JS Simple | Python SDK |
|---|---|---|---|---|
| Basic Operations | ||||
| Create secrets | β | β | β | β |
| List secrets | β | β | β | β |
| Get secret details | β | β | β | β |
| Delete secrets | β | β | β | β |
| Usage statistics | β | β | β | β |
| Security Options | ||||
| Password protection | β | β | β | β |
| OTP via email | β | β | β | β |
| OTP via SMS | β | β | β | β |
| File Support | ||||
| File attachments | β | β | β | β |
| Multiple files | β | β | β | β |
| 10MB limit validation | β | β | β | β |
| Advanced Features | ||||
| Advanced filtering | β | β | β | β |
| Active secrets only | β | β | β | β |
| Stdin/pipe input | β | β | β | β |
| Output Formats | ||||
| JSON output | β | β | β | β |
| Table format | β | β | β | β |
| Verbose mode | β | β | β | β |
| Development | ||||
| TypeScript support | N/A | β | β | N/A |
| Async/await | N/A | β | β | β |
| Error handling | β | β | β | β |
| Unit tests | β | β | β | β |
π Method Consistency β
All libraries use consistent naming for equivalent operations:
| Operation | CLI | JS Complete | JS Simple | Python |
|---|---|---|---|---|
| Create | create | createSecret() | create() | create() |
| List | list | getSecrets() | list() | list() |
| Get | get SLUG | getSecret(slug) | get(slug) | get(slug) |
| Delete | delete SLUG | deleteSecret(slug) | delete(slug) | delete(slug) |
| Stats | stats | getStatistics() | stats() | stats() |
π― Choosing the Right Library β
Use CLI C# when: β
- Building shell scripts or automation
- Integrating with CI/CD pipelines
- Need to pipe data from other commands
- Prefer command-line tools
Use JavaScript Complete when: β
- Building complex web applications
- Need advanced filtering and search
- Working with Node.js servers
- Want full TypeScript support
Use JavaScript Simple when: β
- Quick prototype or simple integration
- Minimal bundle size is important
- Basic secret operations are sufficient
- Getting started with Sharokey
Use Python SDK when: β
- Building Python applications
- Working with data science/ML projects
- Need async/await support
- Prefer CLI-consistent method names
π Library Documentation β
π¨ JavaScript SDK
Full-featured library for complex web applications and Node.js.
View Documentation ββ‘ JavaScript CDN
Lightweight library for quick integrations and simple projects.
View Documentation βπ Related Resources β
- Feature Comparison - Detailed side-by-side comparison
- Migration Guide - Switch between libraries
- Contributing - Help improve the libraries
- API Reference - Direct REST API documentation
