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
JavaScript SDKNode.js apps, complex web projectsFull feature set, npm package, TypeScript support
JavaScript CDNQuick browser integration, simple projectsSingle file, no build required, plug-and-play
Python SDKPython apps, data science, MLAsync/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.CLI
bash
npm install sharokey-client
# or
yarn add sharokey-client
html
<!-- 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 1
javascript
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.docx
javascript
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 ​

FeatureCLI C#JS CompleteJS SimplePython 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 supportN/Aβœ…βœ…N/A
Async/awaitN/Aβœ…βœ…βœ…
Error handlingβœ…βœ…βœ…βœ…
Unit testsβœ…βœ…βœ…βœ…

πŸ“‹ Method Consistency ​

All libraries use consistent naming for equivalent operations:

OperationCLIJS CompleteJS SimplePython
CreatecreatecreateSecret()create()create()
ListlistgetSecrets()list()list()
Getget SLUGgetSecret(slug)get(slug)get(slug)
Deletedelete SLUGdeleteSecret(slug)delete(slug)delete(slug)
StatsstatsgetStatistics()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 ​

πŸ–₯️ CLI C#

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

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

🐍 Python SDK

Async Python client with CLI-consistent method naming.

View Documentation β†’

Released under the MIT License.