Skip to content

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 ​

LibraryBest ForKey Features
CLI C#Shell scripts, CI/CD, automationCross-platform executable, pipe support
Python SDKPython apps, Django/FastAPI projectsAsync/await, type hints, comprehensive error handling
JavaScript SDKNode.js apps, TypeScript projectsNPM package, full type support, universal compatibility
JavaScript CDNQuick browser integration, simple projectsSingle file, no build required, plug-and-play

πŸ“¦ Installation ​

bash
# Download latest release
curl -L https://github.com/Sharokey/sharokey-cli/releases/latest/download/sharokey.exe -o sharokey.exe
bash
# Install via pip
pip install sharokey
bash
# Install via NPM
npm install Sharokey/sharokey-js
html
<!-- 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 ​

bash
sharokey create "My secret password" --hours 24 --views 1
python
# 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)
javascript
// 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);
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);

With File Attachments ​

bash
sharokey create "Confidential docs" --hours 48 --views 3 \
  --attach contract.pdf --attach specs.docx
python
from sharokey import SharokeyClient
client = SharokeyClient(token='your-token')
secret = await client.create('Confidential docs', 48, 3,
  attachments=['contract.pdf', 'specs.docx']  # File paths
)
javascript
import Sharokey from 'sharokey-js';
const secret = await Sharokey.create('Confidential docs', 48, 3, {
  attachments: [contractFile, specsFile] // File objects
});
javascript
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:

  1. Secrets are encrypted before transmission - Only encrypted data reaches our servers
  2. Keys are split - Server stores KeyA, client generates KeyB in URL fragment
  3. Server cannot decrypt - We never have both keys simultaneously
  4. 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 ​

FeatureCLI C#Python SDKJS SDKJS 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/definitionsN/Aβœ…βœ…βŒ
Async/awaitN/Aβœ…βœ…βœ…
Error handlingβœ…βœ…βœ…βœ…
Unit testsβœ…βœ…βœ…βŒ

πŸ“‹ Method Consistency ​

All libraries use consistent naming for equivalent operations:

OperationCLIPython SDKJS SDKJS CDN
Createcreatecreate()create()create()
Listlistlist()list()list()
Getget SLUGget(slug)get(slug)get(slug)
Deletedelete SLUGdelete(slug)delete(slug)delete(slug)
Statsstatsstats()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 ​

πŸ–₯️ CLI C#

Cross-platform command-line tool for automation and scripting.

View 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 β†’

Released under the MIT License.