Skip to content

Add Node.js quick-start example to README #1

@marketinglior-pixel

Description

@marketinglior-pixel

What needs to be done:
Add a Node.js code example to the README, similar to the existing Python example.

Where: README.md, after the Python Quick Start section.

Reference: The Node.js SDK is in sdk/node/. Look at the existing client class to understand the API.

Expected result:

const { AgentBillClient } = require('agentbill')
const client = new AgentBillClient({ apiKey: 'agb_your_key' })

const check = await client.preflight({ agentId: 'researcher', estimatedUnits: 10 })
if (!check.approved) throw new Error(`Blocked: ${check.reason}`)

// run your agent here

await client.record({ agentId: 'researcher', units: 10 })

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions