@alexrockshouts/miri-sdk
v0.0.19
Published
TypeScript SDK for Miri Autonomous Agent
Downloads
1,668
Maintainers
Readme
Miri TypeScript SDK
This is the official TypeScript SDK for the Miri Autonomous Agent.
Installation
npm install @miri/sdkUsage
import { Api } from "@miri/sdk";
const api = new Api({
baseURL: "http://localhost:8080",
headers: {
"X-Server-Key": "your-secret-key"
}
});
// Example: Send a prompt
api.api.v1PromptCreate({
prompt: "Hello, Miri!"
}).then(response => {
console.log(response.data.response);
});Authentication
Miri uses two types of authentication:
- Server Key Authentication: Standard API endpoints (
/api/v1/*) require theX-Server-Keyheader. - Basic Authentication: Administrative endpoints (
/api/admin/v1/*) require HTTP Basic Auth.
Default admin credentials:
- Username:
admin - Password:
admin-password
Example: Administrative Access
import { Api } from "@miri/sdk";
const api = new Api({
baseURL: "http://localhost:8080",
// Standard auth
headers: {
"X-Server-Key": "your-secret-key"
},
// Admin auth (Basic)
auth: {
username: "admin",
password: "admin-password"
}
});
// Get configuration
api.api.adminV1ConfigList().then(response => {
console.log(response.data);
});Features
- Full support for standard and administrative API endpoints.
- Axios-based HTTP client.
- Complete TypeScript type definitions.
Publishing to NPM
To publish a new version of this SDK:
- Update the version in
package.json. - Login to NPM:
npm login. - Publish:
npm publish --access public.
