Key material helpers
Two small helpers that produce a raw session-key pair with no manager, no state, and no persistence. Reach for these when you only need a keypair — nothing to load, persist, sign with, or subscribe to.
Both return the same SessionKeyMaterial shape:
SessionKeyMaterialaddressAddressPublic address derived from the private key.
privateKeyHexThe raw private key. Handle it with the same care as a wallet mnemonic — see Security & storage.
createSessionKey
Generate a fresh keypair.
import { createSessionKey } from "@symmio/session-key";
const key = createSessionKey();
console.log(key.address); // 0x…SessionKeyMaterialsessionKeyFromPrivateKey
Restore the material from an existing private key — useful when importing a key that lives outside the manager.
import { sessionKeyFromPrivateKey } from "@symmio/session-key";
const key = sessionKeyFromPrivateKey(privateKey);
console.log(key.address);privateKeyHexrequiredA raw EVM private key.
SessionKeyMaterialWhen to use the manager instead
These helpers give you a keypair and nothing more. When you need persistence, expiry, rotation, signing, or state subscription, use createSessionKeyManager — or importPrivateKey to bring an existing key under manager control.