SDK Overview
API reference for the Myco SDK.
Installation
npm install @myco-dev/sdkPackage exports
The SDK is organized into entry points:
| Import path | Description |
|---|---|
@myco-dev/sdk | Core: MycoSDK, MycoProvider, useMyco |
@myco-dev/sdk/auth | Auth: useAuth, ProtectedRoute |
@myco-dev/sdk/data | Data types: Entity, RecordEntry, etc. |
@myco-dev/sdk/workspace | Workspace types |
@myco-dev/sdk/chat | Chat: ChatPage, getToolIcon |
@myco-dev/sdk/server | Server: createServerSDK |
@myco-dev/sdk/markdown | Markdown: Markdown component |
Quick start
import { MycoSDK, MycoProvider, useMyco } from "@myco-dev/sdk";
import type { EntityTypes } from "./types/myco.generated";
// 1. Create SDK instance
const myco = new MycoSDK<EntityTypes>("your-app-key");
// 2. Wrap your app
function App() {
return (
<MycoProvider myco={myco}>
<YourRoutes />
</MycoProvider>
);
}
// 3. Use in components
function MyComponent() {
const myco = useMyco<EntityTypes>();
const { data } = myco.data.useRecords("task");
// ...
}Peer dependencies
| Package | Version |
|---|---|
react | ^18 || ^19 |
@tanstack/react-query | ^5.0.0 |
better-auth | ^1.4 |
ai | ^4.0 || ^5.0 || ^6.0 |
Optional peer dependencies (for chat and markdown features):
| Package | Version | Used by |
|---|---|---|
@ai-sdk/react | ^1.0 || ^2.0 || ^3.0 | Chat |
@markdoc/markdoc | ^0.4 | Markdown |
framer-motion | ^11.0 || ^12.0 | Chat animations |
lucide-react | ^0.400 | Chat icons |
clsx | ^2.0 | Chat styling |