Start

Quickstart for developers

Install @geode/sdk, shield SOL and store, list and open a file from code.

@geode/sdk runs everything in the app from code, in the browser and in Node 22 or later: key derivation, sealing, proving, paying through the relayer and opening. The wallet signs the key message once per client and the shield transaction; every storage payment after that is a proof the relayer submits.

Install

Shell
npm i @geode/sdk

The package is ESM only.

Create a client

createGeode takes a wallet and relayerUrl. The wallet is any object with a publicKey, signMessage and one of signTransaction or signAndSendTransaction, taking and returning raw bytes.

TypeScript
import { createGeode, type GeodeWallet } from '@geode/sdk'

declare const wallet: GeodeWallet

const geode = createGeode({
  wallet,
  relayerUrl: 'https://api.geode.directory',
})

Install and createGeode has every option and how to adapt a Wallet Standard wallet.

Shield, then store

TypeScript
// The one wallet transaction: 0.1 SOL into the pool.
await geode.shield(100_000_000n)

declare const file: File
const stored = await geode.store(file, {
  term: 'permanent',
  onProgress: (e) => console.log(e.kind, e.stage, e.progress),
})

console.log(stored.id)   // Irys id of the ciphertext
console.log(stored.link) // /s/<id>#<key>

The first call asks the wallet to sign the Geode key message. store then seals the file, takes a quote, proves, pays and uploads, and stores the updated manifest through the same stages with kind: 'manifest'.

List and open

TypeScript
const files = await geode.list()
const opened = await geode.open(files[0]!.id)

const blob = new Blob([opened.bytes], { type: opened.type })
console.log(opened.name, blob.size)

open with a key from a share link needs no wallet:

TypeScript
import { createGeode } from '@geode/sdk'

const reader = createGeode({ relayerUrl: 'https://api.geode.directory' })
const shared = await reader.open('<irys id>', '<key from the link fragment>')

Next