Claude Code skill pack for Flexport (24 skills)
Installation
Open Claude Code and run this command:
/plugin install flexport-pack@claude-code-plugins-plus
Use --global to install for all projects, or --project for current project only.
Skills (24)
Configure CI/CD pipelines for Flexport logistics integrations with GitHub Actions, automated API contract testing, and deployment workflows.
Flexport CI Integration
Overview
Set up CI/CD for Flexport logistics integrations: run unit tests with mocked shipment and tracking responses on every PR, execute live API contract validation against the Flexport sandbox on merge to main. Flexport's API covers shipments, booking, customs documentation, and real-time tracking, so CI pipelines verify data transforms for shipment lifecycle events and ensure API contract compatibility across versions.
GitHub Actions Workflow
# .github/workflows/flexport-ci.yml
name: Flexport CI
on:
pull_request:
paths: ['src/flexport/**', 'tests/**']
push:
branches: [main]
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '20' }
- run: npm ci
- run: npm test -- --reporter=verbose
integration-tests:
if: github.ref == 'refs/heads/main'
needs: unit-tests
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '20' }
- run: npm ci
- run: npm run test:integration
env:
FLEXPORT_API_KEY: ${{ secrets.FLEXPORT_API_KEY }}
Mock-Based Unit Tests
// tests/flexport-service.test.ts
import { describe, it, expect, vi } from 'vitest';
import { getShipmentStatus } from '../src/flexport-service';
vi.mock('../src/flexport-client', () => ({
FlexportClient: vi.fn().mockImplementation(() => ({
getShipment: vi.fn().mockResolvedValue({
id: 'shp_abc123',
status: 'in_transit',
origin: { port: 'CNSHA', country: 'CN' },
destination: { port: 'USLAX', country: 'US' },
containers: [{ id: 'MSKU1234567', type: '40ft_hc' }],
estimated_arrival: '2026-04-15T00:00:00Z',
}),
listShipments: vi.fn().mockResolvedValue({ data: [], total_count: 0 }),
})),
}));
describe('Flexport Service', () => {
it('returns shipment tracking status', async () => {
const status = await getShipmentStatus('shp_abc123');
expect(status.status).toBe('in_transit');
expect(status.origin.port).toBe('CNSHA');
});
});
Integration Tests
// tests/integration/flexport.integration.test.ts
import { describe, it, expect } from 'vitest';
const hasKey = !!process.env.FLEXPORT_API_KEY;
describe.skipIf(!hasKey)('Flexport Live API', () => {
it('lists shipments from sandbox', async () => {
const res = await fetch('https://api.flexport.com/shipments?per=1', {
headers: {
'Authorization': `Bearer ${process.env.FLEXPORT_API_KEY}`,
Diagnose and fix common Flexport API errors including HTTP status codes, webhook failures, and data validation issues.
Flexport Common Errors
Overview
Quick reference for the most common Flexport API v2 errors. The API returns standard HTTP codes with JSON error bodies containing code, message, and sometimes details fields.
Error Reference
401 Unauthorized — Invalid or Missing API Key
{ "error": { "code": "UNAUTHORIZED", "message": "Invalid API key" } }
Causes: Missing Authorization header, expired JWT token, revoked API key.
Fix:
# Verify key is set
echo $FLEXPORT_API_KEY | head -c 10
# Test with cURL
curl -s -o /dev/null -w "%{http_code}" \
-H "Authorization: Bearer $FLEXPORT_API_KEY" \
-H "Flexport-Version: 2" \
https://api.flexport.com/shipments?per=1
403 Forbidden — Insufficient Permissions
Causes: API key lacks required scope, IP whitelist blocking, sandbox key used on production.
Fix: Check key permissions in Flexport Portal > Settings > Developer. Ensure key scope includes the endpoint you are calling.
404 Not Found — Resource Does Not Exist
{ "error": { "code": "NOT_FOUND", "message": "Shipment shp_xxx not found" } }
Causes: Wrong ID format, resource deleted, using test ID in production.
Fix: List resources first to get valid IDs:
curl -s -H "Authorization: Bearer $FLEXPORT_API_KEY" \
-H "Flexport-Version: 2" \
https://api.flexport.com/shipments?per=1 | jq '.data.records[0].id'
422 Unprocessable Entity — Validation Failed
{ "error": { "code": "VALIDATION_ERROR", "message": "Invalid port code", "details": [...] } }
Common validation failures:
| Field | Issue | Fix |
|---|---|---|
origin_port.code |
Not a valid UN/LOCODE | Use CNSHA, USLAX, DEHAM format |
hs_code |
Wrong format | Use 6-10 digit codes like 8479.89 |
cargoreadydate |
In the past | Use future ISO date |
freight_type |
Unsupported value | Use ocean, air, or trucking |
incoterm |
Invalid | Use FOB, CIF, EXW, DDP |
429 Too Many Requests
Execute Flexport primary workflow: shipment booking and purchase order management.
Flexport Core Workflow A: Bookings & Purchase Orders
Overview
The primary Flexport integration path: create purchase orders, book shipments, and track cargo through the supply chain. The API v2 uses RESTful endpoints at https://api.flexport.com with JSON payloads.
Prerequisites
- Completed
flexport-install-authsetup - Understanding of Flexport freight types (ocean FCL/LCL, air, trucking)
- Valid shipper/consignee addresses configured in Flexport Portal
Instructions
Step 1: Create a Purchase Order
const BASE = 'https://api.flexport.com';
const headers = {
'Authorization': `Bearer ${process.env.FLEXPORT_API_KEY}`,
'Flexport-Version': '2',
'Content-Type': 'application/json',
};
// POST /purchase_orders — create a PO to track inbound goods
const po = await fetch(`${BASE}/purchase_orders`, {
method: 'POST',
headers,
body: JSON.stringify({
name: 'PO-2025-001',
status: 'open',
buyer: { name: 'Acme Corp', address: { country: 'US' } },
seller: { name: 'Shanghai Supplier', address: { country: 'CN' } },
line_items: [
{ sku: 'WIDGET-A', quantity: 500, unit_of_measure: 'pieces' },
{ sku: 'WIDGET-B', quantity: 200, unit_of_measure: 'pieces' },
],
cargo_ready_date: '2025-04-15',
must_arrive_by: '2025-05-20',
}),
}).then(r => r.json());
console.log(`PO created: ${po.data.id}`);
Step 2: Create a Booking
// POST /bookings — book freight against a purchase order
const booking = await fetch(`${BASE}/bookings`, {
method: 'POST',
headers,
body: JSON.stringify({
freight_type: 'ocean', // ocean, air, trucking
incoterm: 'FOB', // FOB, CIF, EXW, DDP, etc.
origin_port: { code: 'CNSHA' }, // Shanghai
destination_port: { code: 'USLAX' }, // Los Angeles
cargo_ready_date: '2025-04-15',
purchase_order_ids: [po.data.id],
wants_freight_management: true,
wants_customs_service: true,
}),
}).then(r => r.json());
console.log(`Booking: ${booking.data.id} | Status: ${booking.data.status}`);
Step 3: Track Shipment Milestones
// GET /shipments/:id — once booking is confirmed, a shipment is created
// Milestones include: cargo_ready, departed, arrived, customs_cleared, delivered
const shipment = await fetch(
`${BASE}/shipments/${booking.data.shipment_id}`, { headers }
).then(r => r.json());
console.log(`Shipment ${shipment.data.id}:`);
console.log(` Status: ${shipment.data.status}`);
console.log(` ETD: ${shipment.data.estimated_departure_date}`);
console.log(` ETA: ${shipment.data.estimated_arrivalExecute Flexport secondary workflow: commercial invoices, products catalog, and freight invoices.
Flexport Core Workflow B: Invoices & Products
Overview
Manage Flexport commercial invoices for customs clearance, maintain the product catalog for landed cost calculations, and handle freight billing. These APIs complement the booking/shipment workflow in flexport-core-workflow-a.
Prerequisites
- Completed
flexport-install-authsetup - Existing shipments or bookings (from workflow A)
- Product SKUs defined in your system
Instructions
Step 1: Manage Product Catalog
const BASE = 'https://api.flexport.com';
const headers = {
'Authorization': `Bearer ${process.env.FLEXPORT_API_KEY}`,
'Flexport-Version': '2',
'Content-Type': 'application/json',
};
// POST /products — add products to the Flexport Product Library
const product = await fetch(`${BASE}/products`, {
method: 'POST',
headers,
body: JSON.stringify({
name: 'Industrial Widget Type A',
sku: 'WIDGET-A',
hs_code: '8479.89', // Harmonized System code for customs
country_of_origin: 'CN',
unit_cost: { amount: 12.50, currency: 'USD' },
weight: { value: 2.5, unit: 'kg' },
dimensions: { length: 30, width: 20, height: 15, unit: 'cm' },
}),
}).then(r => r.json());
console.log(`Product: ${product.data.id} | SKU: ${product.data.sku}`);
Step 2: Create Commercial Invoices
// POST /commercial_invoices — required for customs clearance
const invoice = await fetch(`${BASE}/commercial_invoices`, {
method: 'POST',
headers,
body: JSON.stringify({
shipment_id: 'shp_abc123',
invoice_number: 'CI-2025-001',
seller: { name: 'Shanghai Supplier Co.' },
buyer: { name: 'Acme Corp' },
line_items: [
{
product_id: product.data.id,
quantity: 500,
unit_price: { amount: 12.50, currency: 'USD' },
total_price: { amount: 6250.00, currency: 'USD' },
},
],
total_value: { amount: 6250.00, currency: 'USD' },
currency: 'USD',
incoterm: 'FOB',
}),
}).then(r => r.json());
console.log(`Invoice: ${invoice.data.id} | Total: $${invoice.data.total_value.amount}`);
Step 3: Retrieve Freight Invoices
// GET /freight_invoices — Flexport billing for freight services
const freightInvoices = await fetch(
`${BASE}/freight_invoices?status=outstanding&per=10`, { headers }
).then(r => r.json());
freightInvoices.data.records.forEach((inv: any) => {
console.log(`${inv.invoice_number} | ${inv.status} | $${inv.total.amount}`);
inv.line_items?.forEach((li: any) => {
console.log(` ${li.description}: $${li.amount.amount}`);
});
});
Optimize Flexport API usage costs through efficient pagination, caching, webhook-driven updates, and monitoring API call volume.
Flexport Cost Tuning
Overview
Reduce Flexport API costs by minimizing unnecessary calls. Key strategies: use webhooks instead of polling, cache aggressively, maximize page sizes, and batch operations.
Instructions
Strategy 1: Webhooks Over Polling
// BAD: Polling every 5 minutes (288 API calls/day per shipment)
setInterval(async () => {
const shipment = await flexport(`/shipments/${id}`);
if (shipment.data.status !== lastStatus) updateDB(shipment);
}, 5 * 60 * 1000);
// GOOD: Webhook-driven (0 API calls — Flexport pushes updates)
app.post('/webhooks/flexport', (req, res) => {
const event = req.body;
if (event.type === 'shipment.milestone') {
updateDB(event.data); // Only processes real changes
}
res.sendStatus(200);
});
// Savings: 100 shipments * 288 calls/day = 28,800 calls/day eliminated
Strategy 2: Maximize Page Size
// BAD: Default pagination (per=25)
// 1000 shipments = 40 API calls
// GOOD: Max pagination (per=100)
// 1000 shipments = 10 API calls (75% reduction)
const shipments = await flexport('/shipments?per=100&page=1');
Strategy 3: Cache with Smart TTLs
| Data Type | Change Frequency | Cache TTL | Impact |
|---|---|---|---|
| Products | Rarely | 1 hour | ~95% fewer calls |
| Shipment list | Every few hours | 5 minutes | ~90% fewer calls |
| Shipment detail | On milestones | Until webhook | ~99% fewer calls |
| Purchase orders | Daily | 15 minutes | ~85% fewer calls |
| Freight invoices | Monthly | 1 hour | ~95% fewer calls |
Strategy 4: Monitor API Usage
// Track API call volume per endpoint
const apiMetrics = new Map<string, { count: number; lastReset: Date }>();
function trackAPICall(endpoint: string) {
const key = endpoint.split('?')[0]; // Strip query params
const metric = apiMetrics.get(key) || { count: 0, lastReset: new Date() };
metric.count++;
apiMetrics.set(key, metric);
}
// Report daily usage
function reportUsage() {
console.log('=== Flexport API Usage ===');
for (const [endpoint, { count }] of apiMetrics) {
console.log(` ${endpoint}: ${count} calls`);
}
}
Cost Reduction Checklist
- [ ] Replace polling with webhooks for shipment tracking
- [ ] Use
per=100on all list endpoints - [ ] Cache product catalog (1hr TTL)
- [ ] Cache shipment data, invalidate on webhooks
- [ ] Eliminate duplicate calls in page loads
- [ ] Monitor API call volume weekly
Resources
Collect Flexport API debug evidence for support tickets and troubleshooting.
Flexport Debug Bundle
Overview
Collect all necessary diagnostic information for Flexport support tickets. The bundle captures API connectivity, authentication status, recent shipment data, and error logs while automatically redacting secrets.
Instructions
Step 1: Create Debug Bundle Script
#!/bin/bash
# flexport-debug.sh — run with: bash flexport-debug.sh
set -euo pipefail
BUNDLE="flexport-debug-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$BUNDLE"
echo "=== Flexport Debug Bundle ===" | tee "$BUNDLE/summary.txt"
echo "Generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$BUNDLE/summary.txt"
echo "Node: $(node --version 2>/dev/null || echo 'not found')" >> "$BUNDLE/summary.txt"
echo "API Key set: ${FLEXPORT_API_KEY:+YES}" >> "$BUNDLE/summary.txt"
Step 2: Test API Connectivity
# API health and auth check
echo -e "\n--- API Connectivity ---" >> "$BUNDLE/summary.txt"
RESPONSE=$(curl -s -w "\n%{http_code}" \
-H "Authorization: Bearer $FLEXPORT_API_KEY" \
-H "Flexport-Version: 2" \
https://api.flexport.com/shipments?per=1 2>&1)
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
BODY=$(echo "$RESPONSE" | head -n -1)
echo "HTTP Status: $HTTP_CODE" >> "$BUNDLE/summary.txt"
echo "$BODY" | jq '{total_count: .data.total_count, has_records: (.data.records | length > 0)}' \
>> "$BUNDLE/api-test.json" 2>/dev/null || echo "Parse failed" >> "$BUNDLE/api-test.json"
Step 3: Capture Recent Errors
# Collect recent error logs (redacted)
echo -e "\n--- Recent Errors ---" >> "$BUNDLE/summary.txt"
grep -i "flexport\|FLEXPORT" /var/log/app/*.log 2>/dev/null | \
tail -50 | \
sed 's/Bearer [^ ]*/Bearer ***REDACTED***/g' \
>> "$BUNDLE/errors.txt" 2>/dev/null || echo "No app logs found" >> "$BUNDLE/errors.txt"
# Capture env config (redacted)
env | grep -i FLEXPORT | sed 's/=.*/=***REDACTED***/' >> "$BUNDLE/env-redacted.txt"
Step 4: Check Status Page and Package
# Flexport platform status
echo -e "\n--- Platform Status ---" >> "$BUNDLE/summary.txt"
curl -s https://status.flexport.com/api/v2/status.json | \
jq '{status: .status.description, updated: .page.updated_at}' \
>> "$BUNDLE/status.json" 2>/dev/null || echo "Status page unreachable" >> "$BUNDLE/status.json"
# Package and output
tar -czf "$BUNDLE.tar.gz" "$BUNDLE"
rm -rf "$BUNDLE"
ecDeploy Flexport logistics integrations to Vercel, Fly.
Flexport Deploy Integration
Overview
Deploy Flexport-powered applications to production. Webhook receivers need always-on hosting. Dashboards can use serverless. Background sync workers suit containers.
Instructions
Option A: Vercel (Dashboard + Webhook Routes)
// app/api/webhooks/flexport/route.ts (Next.js App Router)
import crypto from 'crypto';
export async function POST(req: Request) {
const body = await req.text();
const sig = req.headers.get('x-hub-signature') || '';
const expected = 'sha256=' + crypto.createHmac('sha256', process.env.FLEXPORT_WEBHOOK_SECRET!)
.update(body).digest('hex');
if (!crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected))) {
return new Response('Invalid signature', { status: 401 });
}
const event = JSON.parse(body);
// Process milestone, booking, invoice events
return new Response('OK');
}
Option B: Fly.io (Always-On Webhook Receiver)
# fly.toml
app = "flexport-webhooks"
primary_region = "iad"
[http_service]
internal_port = 3000
force_https = true
min_machines_running = 1
fly secrets set FLEXPORT_API_KEY="key" FLEXPORT_WEBHOOK_SECRET="secret"
fly deploy
Option C: Cloud Run (Shipment Sync Worker)
gcloud run deploy flexport-sync \
--source . --region us-central1 \
--set-secrets "FLEXPORT_API_KEY=flexport-key:latest" \
--min-instances 1 --timeout 300
Post-Deploy Verification
curl -X POST https://your-app.fly.dev/webhooks/flexport \
-H "X-Hub-Signature: sha256=invalid" -d '{"type":"test"}'
# Expected: 401 (signature verification working)
Resources
Next Steps
For webhook event handling, see flexport-webhooks-events.
Configure role-based access control for Flexport integrations with scoped API keys, multi-tenant patterns, and organization-level permission management.
Flexport Enterprise RBAC
Overview
Implement role-based access control for Flexport integrations. Since Flexport API keys are scoped at the account level, RBAC is implemented in your application layer with per-role API key allocation and request filtering.
Instructions
Step 1: Define Roles
| Role | API Key Scope | Allowed Endpoints | Use Case |
|---|---|---|---|
| Viewer | Read-only | GET /shipments, GET /products |
Dashboard users |
| Operator | Read-write | GET/POST /bookings, GET/PATCH /purchase_orders |
Ops team |
| Finance | Read invoices | GET /freightinvoices, GET /commercialinvoices |
Finance team |
| Admin | Full access | All endpoints | System administrators |
Step 2: Application-Layer RBAC
type Role = 'viewer' | 'operator' | 'finance' | 'admin';
const ROLE_PERMISSIONS: Record<Role, { methods: string[]; paths: RegExp[] }> = {
viewer: {
methods: ['GET'],
paths: [/^\/shipments/, /^\/products/, /^\/purchase_orders/],
},
operator: {
methods: ['GET', 'POST', 'PATCH'],
paths: [/^\/shipments/, /^\/bookings/, /^\/purchase_orders/, /^\/products/],
},
finance: {
methods: ['GET'],
paths: [/^\/freight_invoices/, /^\/commercial_invoices/, /^\/shipments/],
},
admin: {
methods: ['GET', 'POST', 'PATCH', 'DELETE'],
paths: [/.*/],
},
};
function checkPermission(role: Role, method: string, path: string): boolean {
const perms = ROLE_PERMISSIONS[role];
return perms.methods.includes(method) && perms.paths.some(p => p.test(path));
}
// Middleware
function rbacMiddleware(role: Role) {
return (req: Request, res: Response, next: NextFunction) => {
const flexportPath = req.params.flexportPath;
if (!checkPermission(role, req.method, `/${flexportPath}`)) {
return res.status(403).json({ error: 'Insufficient permissions' });
}
next();
};
}
Step 3: Multi-Tenant API Key Management
// Each tenant/team gets their own Flexport API key
interface TenantConfig {
tenantId: string;
flexportApiKey: string;
role: Role;
allowedShipmentPrefixes?: string[]; // Filter visible data
}
class MultiTenantFlexport {
private configs: Map<string, TenantConfig>;
async request(tenantId: string, path: string, options: RequestInit = {}) {
const config = this.configs.get(tenantId);
if (!config) throw new Error('Unknown tenant');
if (!checkPermission(config.role, options.method || 'GET', path)) {
Create a minimal working Flexport example — list shipments and track containers.
Flexport Hello World
Overview
List shipments and retrieve tracking milestones using the Flexport REST API v2. Flexport has no npm SDK -- you call https://api.flexport.com directly with bearer token auth and a Flexport-Version: 2 header.
Prerequisites
FLEXPORTAPIKEYenvironment variable set- Completed
flexport-install-authsetup - Node.js 18+ (uses native
fetch)
Instructions
Step 1: List Your Shipments
// src/flexport/hello.ts
const BASE = 'https://api.flexport.com';
const headers = {
'Authorization': `Bearer ${process.env.FLEXPORT_API_KEY}`,
'Flexport-Version': '2',
'Content-Type': 'application/json',
};
// List shipments with pagination
const res = await fetch(`${BASE}/shipments?per=5&page=1`, { headers });
const { data } = await res.json();
data.records.forEach((shipment: any) => {
console.log(`${shipment.id} | ${shipment.status} | ${shipment.freight_type}`);
console.log(` Origin: ${shipment.origin_port?.name ?? 'N/A'}`);
console.log(` Dest: ${shipment.destination_port?.name ?? 'N/A'}`);
});
Step 2: Get Shipment Details with Milestones
// Retrieve a single shipment with tracking milestones
const shipmentId = data.records[0].id;
const detail = await fetch(`${BASE}/shipments/${shipmentId}`, { headers }).then(r => r.json());
console.log(`\nShipment ${detail.data.id}:`);
console.log(` Status: ${detail.data.status}`);
console.log(` Cargo ready: ${detail.data.cargo_ready_date}`);
console.log(` Containers: ${detail.data.containers?.length ?? 0}`);
Step 3: List Containers on a Shipment
// Get container details for ocean freight shipments
const containers = await fetch(
`${BASE}/shipments/${shipmentId}/containers`, { headers }
).then(r => r.json());
containers.data.records.forEach((c: any) => {
console.log(`Container ${c.container_number} | ${c.container_type} | ${c.status}`);
});
Output
shp_abc123 | in_transit | ocean
Origin: Shanghai Port
Dest: Los Angeles Port
Shipment shp_abc123:
Status: in_transit
Cargo ready: 2025-03-01
Containers: 2
Container MSKU1234567 | 40ft_hc | in_transit
Error Handling
| Error | Cause | Solution | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 401 Unauthorized | Invalid API key | Check FLEXPORTAPIKEY env var |
||||||||||||||||||||||||||||||||||||||||||||||||||
| 404 Not Found | Wrong shipment ID | Verify ID from /shipments list |
||||||||||||||||||||||||||||||||||||||||||||||||||
| 422 Unprocessable | Bad query params | Check per/page are integers |
||||||||||||||||||||||||||||||||||||||||||||||||||
| Empty records array
Execute Flexport incident response for API outages, webhook failures, and supply chain data sync issues with triage and mitigation steps.
ReadBash(curl:*)Bash(jq:*)Grep
Flexport Incident RunbookOverviewIncident response procedures for Flexport logistics API integration failures. Covers shipment tracking outages, customs data sync failures, webhook delivery loss, and API degradation scenarios. Flexport powers real-time supply chain visibility, so incidents directly impact shipment tracking, booking workflows, and customs compliance reporting. Classify severity immediately using the matrix below, then follow the matching playbook. Severity Levels
Diagnostic Steps
Incident PlaybooksAPI Outage
Authentication Failure
Data Sync Failure
Install and configure Flexport API authentication with API keys or OAuth credentials.
ReadWriteEditBash(npm:*)Bash(curl:*)Grep
Flexport Install & AuthOverviewConfigure Flexport API authentication for logistics and supply chain integration. Flexport offers two auth methods: API Keys (simple bearer tokens that never expire) and API Credentials (client ID/secret pairs that issue JWTs valid for 24 hours). The v2 REST API base URL is Prerequisites
InstructionsStep 1: Obtain API CredentialsNavigate to Flexport Portal > Settings > Developer. Two options:
Step 2: Configure Environment Variables
Step 3: Authenticate with API Key
Step 4: OAuth Credentials Flow (Production)Configure Flexport local development with mock API responses and testing.
ReadWriteEditBash(npm:*)Bash(pnpm:*)Grep
Flexport Local Dev LoopOverviewSet up a fast, reproducible local development workflow for Flexport integrations. Since Flexport has no official SDK, the dev loop centers on a typed HTTP client wrapper with mock responses for testing. InstructionsStep 1: Project Structure
Step 2: Typed Client Wrapper
Step 3: Mock Data for Testing
Step 4: Vitest Unit TestsExecute major migration strategies for Flexport including migrating from legacy freight forwarders, ERP system integration, and strangler fig patterns.
ReadWriteEditBash(npm:*)Grep
Flexport Migration Deep DiveOverviewGuide for migrating to Flexport from legacy freight forwarders, manual spreadsheet workflows, or other logistics platforms. Uses a strangler fig pattern to gradually move operations to the Flexport API while maintaining existing systems. Migration Scenarios
InstructionsPhase 1: Data Migration — Product Catalog
Phase 2: Strangler Fig — Dual-Write
<Configure Flexport API across dev, staging, and production environments with isolated API keys, separate webhook endpoints, and environment guards.
ReadWriteEditGrep
Flexport Multi-Environment SetupOverviewConfigure isolated Flexport environments for development, staging, and production with separate API keys, webhook endpoints, and safety guards to prevent production data access from dev. InstructionsEnvironment Configuration
Environment Variable Template
Production Safety Guard
Environment Matrix |