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 |
Python SDK | Python apps, Django/FastAPI projects | Async/await, type hints, comprehensive error handling |
JavaScript SDK | Node.js apps, TypeScript projects | NPM package, full type support, universal compatibility |
JavaScript CDN | Quick browser integration, simple projects | Single file, no build required, plug-and-play |
π¦ Installation β
# Download latest release
curl -L https://github.com/Sharokey/sharokey-cli/releases/latest/download/sharokey.exe -o sharokey.exe
# Install via pip
pip install sharokey
# Install via NPM
npm install Sharokey/sharokey-js
<!-- Direct script include -->
<script src="https://cdn.jsdelivr.net/gh/Sharokey/sharokey-cdn@latest/sharokey.js"></script>
<!-- Or specific version for production -->
<script src="https://cdn.jsdelivr.net/gh/Sharokey/[email protected]/sharokey.js"></script>
β‘ Quick Start Examples β
Create a Secret β
sharokey create "My secret password" --hours 24 --views 1
# Async/await with type hints
from sharokey import SharokeyClient
client = SharokeyClient(token='your-token')
secret = await client.create('My secret password', 24, 1)
print(secret.share_url)
// ES Module import
import Sharokey from 'sharokey-js';
Sharokey.config({ token: 'your-token' });
const secret = await Sharokey.create('My secret password', 24, 1);
console.log(secret.share_url);
// 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);
With File Attachments β
sharokey create "Confidential docs" --hours 48 --views 3 \
--attach contract.pdf --attach specs.docx
from sharokey import SharokeyClient
client = SharokeyClient(token='your-token')
secret = await client.create('Confidential docs', 48, 3,
attachments=['contract.pdf', 'specs.docx'] # File paths
)
import Sharokey from 'sharokey-js';
const secret = await Sharokey.create('Confidential docs', 48, 3, {
attachments: [contractFile, specsFile] // File objects
});
const secret = await Sharokey.create('Confidential docs', 48, 3, {
attachments: [contractFile, specsFile] // File objects
});
π Zero Knowledge Architecture β
All libraries implement mandatory client-side encryption. The raw API cannot be used directly because encryption is handled entirely by our SDKs.
Technical Implementation β
- AES-GCM-256 encryption with authenticated data
- PBKDF2 key derivation (10,000 iterations) from secure random salt
- Client-side encryption - your data never leaves your device unencrypted
- Two-key system - KeyA (server storage) + KeyB (share URL fragment)
- Perfect Forward Secrecy - each secret uses unique encryption keys
Why SDKs are Required β
The Sharokey platform implements true Zero Knowledge security, which means:
- Secrets are encrypted before transmission - Only encrypted data reaches our servers
- Keys are split - Server stores KeyA, client generates KeyB in URL fragment
- Server cannot decrypt - We never have both keys simultaneously
- No raw API access - Direct API calls would bypass encryption entirely
This architecture ensures that even if our servers were compromised, your secrets would remain secure because we never store the complete decryption key.
π Feature Matrix β
Feature | CLI C# | Python SDK | JS SDK | JS CDN |
---|---|---|---|---|
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 | β | β | β | β |
Development | ||||
Type hints/definitions | N/A | β | β | β |
Async/await | N/A | β | β | β |
Error handling | β | β | β | β |
Unit tests | β | β | β | β |
π Method Consistency β
All libraries use consistent naming for equivalent operations:
Operation | CLI | Python SDK | JS SDK | JS CDN |
---|---|---|---|---|
Create | create | create() | create() | create() |
List | list | list() | list() | list() |
Get | get SLUG | get(slug) | get(slug) | get(slug) |
Delete | delete SLUG | delete(slug) | delete(slug) | delete(slug) |
Stats | stats | stats() | 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 Python SDK when: β
- Building Python applications (Django, FastAPI, Flask)
- Need async/await with comprehensive type hints
- Require robust error handling and validation
- Working with data science or automation projects
Use JavaScript SDK when: β
- Building Node.js applications or TypeScript projects
- Need full type support and modern ES modules
- Require comprehensive error handling and validation
- Working with enterprise applications
Use JavaScript CDN when: β
- Quick prototype or simple integration
- Minimal bundle size is important
- Basic secret operations are sufficient
- Getting started with Sharokey
π Library Documentation β
π Python SDK
Async/await package with type hints and comprehensive error handling.
View Documentation βπ¦ JavaScript SDK
NPM package with TypeScript support and Node.js/Browser compatibility.
View Documentation ββ‘ JavaScript CDN
Lightweight library for quick integrations and simple projects.
View Documentation βπ Code Examples
See all examples side-by-side across every library with live code samples.
Browse Examples β