Skip to main content

1. Pre-Assessment & Authentication

The following methods are available via the AgriBackup SDK for this integration stage.

Assess risk by polygon (Pre-Assessment)

Runs Country Risk Matrix lookups and satellite Sentinel-2 deforestation analysis on-the-fly for a GeoJSON polygon.

import { AgriBackupClient } from 'agribackup';

const client = new AgriBackupClient('sk_live_...');
const response = await client.riskManagement.assessPolygonRisk(/* args */);
console.log(response.data);

Assess risk by coordinate (Pre-Assessment)

Runs Country Risk Matrix lookups and satellite Sentinel-2 deforestation analysis on-the-fly for a coordinate, returning predictive risk metrics without registering a batch.

import { AgriBackupClient } from 'agribackup';

const client = new AgriBackupClient('sk_live_...');
const response = await client.riskManagement.assessCoordinateRisk(/* args */);
console.log(response.data);

Ingest TRACES NT Credentials into Vault

Accepts the raw TRACES NT API token/password, symmetrically encrypts it via HashiCorp Vault Transit Engine, and stores the resulting ciphertext reference.

import { AgriBackupClient } from 'agribackup';

const client = new AgriBackupClient('sk_live_...');
const response = await client.credentials.ingestTracesCredentials(/* args */);
console.log(response.data);

Revoke and purge TRACES NT credentials

Deletes the organization's TRACES NT credentials reference from the database, permanently revoking delegation. Due to our stateless transit-based encryption, clearing the ciphertext reference completely purges the secret from the system.

import { AgriBackupClient } from 'agribackup';

const client = new AgriBackupClient('sk_live_...');
const response = await client.credentials.deleteTracesCredentials(/* args */);
console.log(response.data);

List API Keys

Returns a list of all active API keys for the organization (without raw keys).

import { AgriBackupClient } from 'agribackup';

const client = new AgriBackupClient('sk_live_...');
const response = await client.apiKeys.listApiKeys(/* args */);
console.log(response.data);

Generate a new API Key

Generates a new secure API Key with defined scopes. Returns the raw key only once.

import { AgriBackupClient } from 'agribackup';

const client = new AgriBackupClient('sk_live_...');
const response = await client.apiKeys.createApiKey(/* args */);
console.log(response.data);

Rotate an API Key

Deactivates the old key and generates a new raw key with the same configuration.

import { AgriBackupClient } from 'agribackup';

const client = new AgriBackupClient('sk_live_...');
const response = await client.apiKeys.rotateApiKey(/* args */);
console.log(response.data);

Check TRACES NT credential delegation status

Verifies if the credentials registered in HashiCorp Vault for this organization are valid by executing a connection test to the TRACES NT SOAP API.

import { AgriBackupClient } from 'agribackup';

const client = new AgriBackupClient('sk_live_...');
const response = await client.credentials.getTracesCredentialsStatus(/* args */);
console.log(response.data);

Delete an API Key

Permanently removes an API key.

import { AgriBackupClient } from 'agribackup';

const client = new AgriBackupClient('sk_live_...');
const response = await client.apiKeys.deleteApiKey(/* args */);
console.log(response.data);