@enc-protocol/personal-sdk
v0.9.0
Published
ENC Protocol per-app SDK for the "personal" app — public + private posts. Enclaves: Personal, Group.
Maintainers
Readme
@enc-protocol/personal-sdk
Per-app SDK for the personal app on ENC Protocol. Enclaves: Personal, Group.
Auto-generated by
lib/codegen/readme-codegen.mjsfromapps/personal/{app,schema}.json. Do not hand-edit — regenerate viaenc gen readme personal.
Install
Recommended — via the enc CLI
# Install the global enc CLI once (any project)
npm install -g @enc-protocol/cli
# Install the skill into the current project (.claude/commands/personal.md)
enc skill add personalThe skill is the recommended consumption surface for Claude Code — adds an /enc personal slash command. The skill package is published as @enc-protocol/skill-personal.
Programmatic — for direct SDK use
npm install @enc-protocol/personal-sdkQuick example
import { PersonalSdk } from '@enc-protocol/personal-sdk'
const sdk = new PersonalSdk({ mode: 'cf', nodeUrl: process.env.NODE_URL })
await sdk.init()
await sdk.submitPublic({"draft":"example"})
const events = await sdk.queryPublic()API reference
new PersonalSdk(opts)
Constructor. Accepts:
| Option | Type | Description |
|--------|------|-------------|
| mode | 'mem' \| 'cf' | Backend: in-process mem or HTTP cf |
| identity | Identity | Required for cf mode (signing keypair) |
| nodeUrl | string | cf-mode node URL (or set NODE_URL env) |
| repoRoot | string | Path to repo root for finding apps/<id>/ and enclaves/<Name>.json (defaults to package location) |
| encHome | string | Optional state directory (defaults to ~/.enc) |
async init()
Initialize the SDK: load app definition, register all 2 enclaves (Personal, Group), wire dataview, mint cf enclaves if needed.
Write methods
| Method | Data type | Resolves to | Encrypted | Ops | Operators |
|--------|-----------|-------------|-----------|-----|-----------|
| submitPublic(args) | public | Personal.public | | CDU | OWNER | dataview |
| submitPrivate(args) | private | Personal.private | ✓ | CDU | OWNER |
Read methods
| Method | Read | Source | Fields |
|--------|------|--------|--------|
| queryPublic() | public | Personal.public | body, from, trailing |
| queryProfiles() | profiles | dataview (cross_enclave) | all |
| queryPrivate() | private | Personal.private | body, from, trailing |
| queryNotices() | notices | dataview (cross_enclave) | greeting, from, trailing |
Encryption
Data types private are flagged encrypt in the app schema. The SDK calls this._encrypt(dataType, args) before submit. The default _encrypt is a pass-through.
To add real encryption (e.g. MLS for DM), subclass and override:
class EncryptedPersonalSdk extends PersonalSdk {
async _encrypt(dataType, args) {
// produce ciphertext for `args`
return { ciphertext: /* ... */ }
}
}Composition
- Enclaves:
Personal,Group - tableMap:
public→public,private→private,notices→notice - encrypt:
private
See also
cli.json— full app metadata + fuzz contractskill/SKILL.md— Claude Code skill bundle (install viaenc skill install personal)@enc-protocol/app-sdk-base— base class (AppSdk,AppClient,DataView)
