Complete reference for the Scc client and all sub-APIs.
import { Scc , MessageChannel , Server , SccError } from 'scc-opensdk' ;
const scc = new Scc ( {
userData : string , // required — vault root path
username : string , // required
password : string , // required
vault ?: string , // unlock name, default: username
host ?: string , // default: 'direct.scc.is'
version ?: string , // default: '0.7.105'
nativePath ?: string , // override scc-node.node path
} ) ;
Scc.connect(options) → Promise<Scc>
Creates a client, runs the full auth + connect sequence, returns a ready instance.
const scc = await Scc . connect ( { userData, username, password } ) ;
Method
Returns
Description
connect()
Promise<Scc>
Login, knock, WebSocket connect
disconnect()
Promise<void>
Close WebSocket
close()
Promise<void>
Disconnect + kill session process
raw(command, args?)
Promise<any>
Direct native invoke
Property
Type
Description
identity
IdentityAPI
Account, settings, registration
friends
FriendsAPI
Friend roster
messages
MessagesAPI
Channel factory
groups
GroupsAPI
Group management
servers
ServersAPI
Server management
events
EventBus
Native event subscriptions
username
string
Configured username
host
string
Relay hostname
version
string
App version
nativePath
string
Resolved scc-node.node path
isConnected
boolean
WebSocket connected
IdentityAPI — scc.identity
Method
Args
Returns
Description
login()
—
Identity
Server authentication
register(opts)
{ username?, password?, displayName? }
Identity
Create new account
unlock(passphrase, name)
strings
void
Decrypt local vault
lock()
—
void
Lock vault
getSettings()
—
Settings
Read app settings
updateSettings(patch)
object
Settings
Write settings
enableTor()
—
Settings
Enable built-in Tor
useSocksProxy(proxy)
string
Settings
Set SOCKS proxy
Returned by login() and register():
{
username: string ;
fingerprint: string ; // "xxxx-xxxx-xxxx-xxxx"
public_key: string ; // base64 Ed25519
name: string ; // display name
}
Method
Args
Returns
Description
list()
—
Friend[]
All friends
add(username)
string
FriendRequest
Send friend request
respond(requestId, accept?)
string, boolean
void
Accept/deny request
remove(username)
string
void
Remove friend
block(username)
string
void
Block user
unblock(username)
string
void
Unblock user
listBlocked()
—
BlockedUser[]
List blocked
{
username: string ;
display_name: string ;
pubkey: string ; // Ed25519 public key
dh_pubkey: string ; // X25519 for DM key agreement
request_id?: string ; // UUID, for respond()
state: 'pending_incoming' | 'pending_outgoing' | 'accepted' ;
}
MessagesAPI — scc.messages
Factory for MessageChannel instances. Does not send messages directly.
Method
Args
Returns
Description
dm(username)
string
MessageChannel
DM to @username
group(groupId)
string
MessageChannel
Group channel g:<id>
channel(address)
string
MessageChannel
Any raw address
Represents a single conversation endpoint.
Property
Type
Description
address
string
Channel address (@user, g:id, srv:...)
Method
Args
Returns
Description
send(body, opts?)
string, SendOptions
string
Send message, returns message UUID
history()
—
Message[]
Channel history
typing()
—
void
Send typing indicator
edit(messageId, body)
string, string
void
Edit own message
delete(messageId)
string
void
Delete message
pin(messageId, pinned?)
string, boolean
void
Pin/unpin message
react(messageId, symbol, add?)
string, string, boolean
void
Add/remove reaction
{
attachments ?: Attachment [ ] ; // default: []
replyTo ?: string | null ; // message UUID
system ?: string | null ; // system message type (avoid in bots)
once ?: boolean ; // view-once message
onceViews ?: number; // default: 1
onceSecs ?: number; // default: 0
}
Received via scc.events.on('message', ...):
{
id: string ; // UUID
channel: string ;
body: string ;
user: string ; // display name
pubkey: string ;
fingerprint: string ;
ts: number ; // Unix seconds
self: boolean ;
verified: boolean ;
edited: boolean ;
pinned: boolean ;
attachments: Attachment [ ] ;
reply_to: string | null ;
system: string | null ;
reactions: Reaction [ ] ;
first_seen: boolean ;
}
Method
Args
Returns
Description
list()
—
Group[]
All groups
create(name, members?)
string, string[]
MessageChannel
Create group
addMember(groupId, username)
string, string
void
Add member
removeMember(groupId, username)
string, string
void
Remove member
rename(groupId, name)
string, string
void
Rename group
leave(groupId)
string
void
Leave group
Method
Args
Returns
Description
list()
—
Server[]
Joined servers
get(serverId)
string
Server
Get by ID
create(name)
string
Server
Create new server
join(inviteLink)
string
Server
Join via invite
refresh()
—
void
Sync from relay
Returned by servers.create(), servers.join(), servers.get().
Property
Type
Description
id
string
Server ID (s_...)
name
string
Display name
owner
string
Owner pubkey (base64)
isOwner
boolean
You own this server
role
string
Your role (owner, member, role ID)
roles
RoleDef[]
Role definitions
members
string[]
Member pubkeys
data
object
Raw server object
channels
ServerChannels
Channel sub-API
invites
ServerInvites
Invite sub-API
moderation
ServerModeration
Moderation sub-API
Method
Args
Returns
Description
refresh()
—
Server
Reload from relay
update(fields)
object
Server
Update server metadata
audit()
—
AuditEntry[]
Audit log
leave()
—
void
Leave server
Method
Args
Returns
list()
—
ChannelInfo[]
findByName(name)
string
ChannelInfo | null
open(channelId)
string
Promise<MessageChannel>
openNamed(name)
string
Promise<MessageChannel>
Method
Args
Returns
create({ expiresIn, maxUses, note })
object
Invite
list()
—
Invite[]
revoke(code)
string
void
Method
Args
Description
kick(target)
username
Remove member (can rejoin)
ban(target)
username
Permanently ban
mute(target, until?)
username, timestamp?
Mute member
unmute(target)
username
Remove mute
addRole(target, roleId)
username, role ID
Assign role
removeRole(target, roleId)
username, role ID
Remove role
setRole(target, roleId)
username, role ID
Replace all roles
setNick(target, nick)
username, string
Set nickname
Method
Args
Returns
Description
on(event, fn)
string, function
unsubscribe
Subscribe to event
off(event, fn)
string, function
void
Unsubscribe
once(event, fn)
string, function
unsubscribe
Subscribe once
See Events for all event names and payloads.
import { SccError , SccTimeoutError } from 'scc-opensdk' ;
Class
When
SccError
Native command failed (error property has message)
SccTimeoutError
Command timed out after 60s
SccConnectionError
Connection-level failure
try {
await scc . messages . dm ( 'nobody' ) . send ( 'hi' ) ;
} catch ( e ) {
if ( e instanceof SccError ) {
console . error ( 'SCC error:' , e . message , 'command:' , e . command ) ;
}
}
Common error strings:
Error
Meaning
unknown channel
Not friends / not in group / channel not opened
no such account
Username doesn't exist
you don't have permission for that
Missing server role permission
server not joined
Not a member of that server
registration failed (429)
Rate limited — use Tor mode
Deprecated alias for Scc with flat methods (sendMessage, createServer, etc.). New code should use Scc and namespaced APIs.
import { SccClient } from 'scc-opensdk' ; // still works