12npm install -g dealmachine dm login
1dm account
123456Account ---------------------------------------- Organization: My Company Org ID: 1 Created: Jan 1, 2024 Auth Type: api_key
~/.dealmachine/config.json. Use it in your code:123456789101112import { readFileSync } from 'fs'; import { join } from 'path'; import { homedir } from 'os'; const config = JSON.parse(readFileSync(join(homedir(), '.dealmachine', 'config.json'), 'utf-8')); const response = await fetch('https://api.v2.dealmachine.com/v1/account', { headers: { Authorization: `Bearer ${config.apiKey}` }, }); const { data } = await response.json(); console.log(data.organization.name);
dm_sk_live_)12curl https://api.v2.dealmachine.com/v1/account \ -H "Authorization: Bearer dm_sk_live_YOUR_KEY_HERE"
1234567891011121314151617181920{ "data": { "organization": { "id": 1, "name": "My Company", "createdAt": "2024-01-01T00:00:00.000Z" }, "user": { "id": null, "authType": "api_key" }, "plan": { "name": "Basic", "enrichment_credit_cap": 10000, "is_paid": true, "billing_cycle_start": "2024-01-01T00:00:00.000Z", "billing_cycle_end": "2024-02-01T00:00:00.000Z" } } }