0.1.0 • Published 8 months ago

@auto-genesis/core v0.1.0

Weekly downloads
-
License
-
Repository
-
Last release
8 months ago

Autonomize Genesis

The official TypeScript SDK for Autonomize Genesis Core API. This SDK provides a simple and intuitive interface to interact with Genesis features like copilots, agents, and more.

Installation

Using npm:

npm install @auto-genesis/genesis

Using yarn:

yarn add @auto-genesis/genesis

Using pnpm:

pnpm add @auto-genesis/genesis

Quick Start

import Genesis from '@auto-genesis/genesis';

// Initialize the SDK with Keycloak authentication
const genesis = new Genesis({
  baseURL: 'https://api-genesis.sprint.autonomize.dev/api/v1/',
  auth: {
    baseUrl: 'https://auth.sprint.autonomize.dev/',
    realm: 'autonomize',
    clientId: 'your-client-id',
    clientSecret: 'your-client-secret',
  },
});

// Initialize authentication
await genesis.initialize();

// Make authenticated API calls
const agent = await genesis.agents.findOne('agentId');
console.log(agent);

Development and Testing

To test new features or debug issues locally:

  1. Clone the repository:

    git clone https://github.com/autonomize-ai/autonomize-sdk-js.git
    cd autonomize-sdk-js
  2. Set up the playground:

    cd playground
    cp .env.example .env   # Configure your environment variables
    pnpm install
  3. Run the Genesis playground:

    pnpm dev:genesis

This will start a development environment where you can test SDK features without publishing to npm.

Authentication

The SDK uses Keycloak for authentication, supporting both client credentials and password grant flows. For detailed authentication configuration and best practices, please refer to our Authentication Documentation.

Basic authentication setup:

const genesis = new Genesis({
  baseURL: 'https://api.example.com',
  auth: {
    baseUrl: 'https://auth.example.com',
    realm: 'your-realm',
    clientId: 'your-client-id',
    grantType: 'client_credentials' // or 'password'
    clientSecret: 'your-client-secret',
    // Optional configurations
    expiresInMins: 10,
  }
});

// Initialize authentication
await genesis.initialize();

Available Services

Copilots

The genesis.copilots service allows you to access and manage anything related to copilots:

// Get assigned copilots
const response = await genesis.copilots.getAssigned({
  page: 1,
  limit: 10,
  search: 'Prior Auth',
});

More services coming soon!

Development Status

This SDK is under active development. More features and improvements are coming soon.

Requirements

  • Node.js >= 18
  • TypeScript >= 5.7.2 (if using TypeScript)
  • Auth (Keycloak) authentication server
  • Valid Auth (Keycloack) client credentials or user credentials

Contributing

We welcome contributions! Please see our contributing guidelines for details.

Security Notes

Please refer to our Authentication Documentation for important security considerations when choosing and implementing authentication flows.

Support

For support, please contact info@autonomize.ai or open an issue in our GitHub repository.