Skip to content

No SDK Integration Guidance #1

Description

@timfong888

From my agent trying to build but evaluate first:

The biggest gap. The CLI is great for using FOC from a terminal. But an agent building a dApp needs to integrate the
Synapse SDK into application code. The CLI source (upload.ts) reveals the actual SDK pattern:

const synapse = new Synapse({ client, source: 'foc-cli' })
const contexts = await synapse.storage.createContexts({ copies, withCDN })
const prep = await synapse.storage.prepare({ context: contexts, dataSize: BigInt(file.byteLength) })
if (prep.transaction) await prep.transaction.execute()
const result = await synapse.storage.upload(fileStream, { contexts, withCDN })

But none of this is documented in the README or skills. An agent reading the SKILL.md would only know CLI commands, not
how to write a Next.js API route that stores files on FOC. The docs.filecoin.cloud site has SDK docs, but:

  • The foc-docs skill only searches by topic — it doesn't proactively guide an agent through SDK setup
  • There's no "build a dApp" cookbook or template
  • The agent would have to reverse-engineer the CLI source to understand the SDK flow

Recommendation: Add a foc-app skill (or a "Building a dApp" section in foc-cli SKILL.md) that shows:

  1. How to install @filoz/synapse-sdk + @filoz/synapse-core + viem
  2. How to create a wallet client (the client.ts pattern)
  3. The upload flow as application code (not CLI commands)
  4. A Next.js API route example
  5. React integration with @filoz/synapse-react hooks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions