ImpactMap SDK
Official SDK for impactmap.io - CRM for impact management
Installation
npm install impactmap
or
yarn add impactmap
Usage
Authentication
First, set your API key for the environment you want to use:
impactmap set-key <environment> <api-key>
List Available Environments
To list all available ImpactMap environments, you'll need to set the internal API key. You have two options:
- Using a
.env file in your project root:
IMPACTMAP_INTERNAL_API_KEY=your_internal_api_key
- Setting it as an environment variable:
export IMPACTMAP_INTERNAL_API_KEY=your_internal_api_key
$env:IMPACTMAP_INTERNAL_API_KEY='your_internal_api_key'
Then you can list the environments:
impactmap list-tenants
This will display a table of all available environments with their names, slugs, statuses, and URLs.
API Reference
TenantsAPI
The TenantsAPI class provides methods for interacting with ImpactMap tenants:
import { ImpactMap } from 'impactmap';
const client = new ImpactMap({
apiKey: 'your-api-key'
});
const tenants = await client.tenants.list();
const tenant = await client.tenants.get('environment-slug');
const projects = await client.projects.list();
### AgentOps Integration
This SDK includes optional integration with AgentOps for monitoring and observability. To enable AgentOps:
1. Get an AgentOps API key from [AgentOps Dashboard](https:
2. Include the AgentOps key in your SDK initialization:
```typescript
import { ImpactMap } from '@citiwave-io/impactmap';
const client = new ImpactMap({
apiKey: 'your_impactmap_api_key',
agentOpsKey: 'your_agentops_api_key' // Optional
});
When AgentOps is enabled, all SDK requests will be automatically tracked and monitored in your AgentOps dashboard. You can view detailed analytics, monitor performance, and track usage patterns at app.agentops.ai.
Tracking Custom Actions
You can track custom actions in your code using our decorators:
import { ImpactMap, track_action, record_action } from '@citiwave-io/impactmap';
@track_action('my-custom-agent')
class MyCustomAgent {
@record_action('custom-operation')
async doSomething() {
}
}
These decorators will help you monitor and analyze the behavior of your custom implementations.
Environment Variables
IMPACTMAP_INTERNAL_API_KEY: Required for tenant listing functionality. This is an internal API key that should be kept secure. Can be set in a .env file or as an environment variable.
Documentation
For detailed documentation, visit docs.impactmap.io.
License
MIT