API utilities for Cortex applications
npm install @cortex-dev/app-apibash
npm install @cortex-dev/app-api
`
Usage
`typescript
import { CortexApi, createCortexApi } from "@cortex-dev/app-api";
// Using the class directly
const api = new CortexApi({ apiKey: "your-api-key" });
api.initialize();
// Using the factory function
const api2 = createCortexApi({ apiKey: "your-api-key" });
api2.initialize();
// Async usage
const data = await api.getData();
console.log(data);
`
Development
`bash
Install dependencies
npm install
Build the package
npm run build
Watch for changes during development
npm run build:watch
Lint the code
npm run lint
Type check
npm run type-check
`
Publishing
`bash
Build and publish to npm
npm publish
`
The prepublishOnly` script will automatically clean and build before publishing.