Set up your development environment
Get familiar with the Ledgerline CLI and our server-side SDKs. You'll use both throughout every guide on this site.
Install the Ledgerline CLI
The CLI lets you create objects, tail API logs and forward webhook events to your local machine.
- macOS
- Linux
- Windows
brew install ledgerline/tap/ledgerlinecurl -fsSL https://get.ledgerline.dev/cli.sh | shscoop bucket add ledgerline https://github.com/ledgerline/scoop-bucket.git
scoop install ledgerlineThen log in. This pairs the CLI with your sandbox and stores a restricted key on your machine.
ledgerline loginInstall a server-side SDK
Language | Package | Minimum version |
|---|---|---|
Node.js |
| Node 18 |
Python |
| Python 3.9 |
Ruby |
| Ruby 3.0 |
Go |
| Go 1.21 |
Java |
| Java 11 |
- Node.js
- Python
- Ruby
- Go
npm install ledgerline --savepip install --upgrade ledgerlinegem install ledgerlinego get github.com/ledgerline/ledgerline-go/v4Run your first SDK request
const ledgerline = require('ledgerline')(process.env.LEDGERLINE_SECRET_KEY);async function main() { const product = await ledgerline.products.create({ name: 'Starter plan' }); const price = await ledgerline.prices.create({ product: product.id, unit_amount: 1200, currency: 'usd', recurring: { interval: 'month' }, }); console.log('Created price', price.id);}main();Never commit a secret key. Load it from an environment variable or a secrets manager, and rotate it from the Dashboard if it leaks.
Was this page helpful?