argus-sdk-demo
Version:
Simple demo application for Argus SDK
90 lines (67 loc) • 2.49 kB
Markdown
# Argus SDK Demo
A simple demonstration application for the Argus SDK that evaluates preset transactions against your financial control policies.
## Quick Start
1. **Install dependencies:**
```bash
npm install
```
2. **Set up your API key:**
```bash
# Copy the example environment file
cp .env.example .env
# Edit .env and add your API key
# ARGUS_API_KEY=argus_your_actual_key_here
```
3. **Run the demo:**
```bash
npm start
```
## Usage Options
### Using Environment Variables
```bash
# Set in .env file or export directly
export ARGUS_API_KEY=argus_your_key_here
npm start
```
### Using Command Line Arguments
```bash
# Specify API key
npm start -- --api-key argus_your_key_here
# Use custom API endpoint
npm start -- --api-key argus_your_key_here --base-url http://localhost:8000
# Run multiple iterations (useful for load testing)
npm start -- --api-key argus_your_key_here --iterations 5
```
### Command Line Options
- `--api-key, -k`: Your Argus API key
- `--base-url, -u`: API base URL (default: http://localhost:8000)
- `--iterations, -i`: Number of times to run all transactions (default: 1)
## What It Does
The demo runs 5 preset transactions with different characteristics:
1. **Morning Coffee** - Small everyday purchase ($4.50)
2. **Grocery Shopping** - Regular purchase ($127.83)
3. **Laptop Purchase** - High-value electronics ($2,499.99)
4. **Luxury Car Down Payment** - Very high amount wire transfer ($25,000)
5. **European Hotel Booking** - Foreign currency transaction (€350)
Each transaction is evaluated against your active policy, and you'll see:
- Decision outcome (Approved/Rejected/Manual Review)
- Decision ID for tracking
- Failed rule (if rejected)
- Response time
## Expected Results
Results will vary based on your policy configuration, but typically:
- Small purchases are approved
- Very large amounts may trigger manual review or rejection
- Different payment methods may have different limits
## Viewing Results in Frontend
After running the demo, you can:
1. Open your Argus frontend dashboard
2. Navigate to the Transactions page to see all evaluated transactions
3. Check the Dashboard for updated metrics and charts
4. Review which rules were triggered in the transaction details
## Development
To modify the demo or add more test scenarios, edit `src/index.ts` and add new transactions to the `transactions` array.
```typescript
// Run in development mode with TypeScript
npm run dev
```