Quickstart
Get Started with Podium
Learn how to install the SDK, configure authentication, and make your first API call in under 5 minutes.
Prerequisites
- Node.js 18+ or Bun runtime
- A Podium API key (get one from your dashboard)
- Basic familiarity with TypeScript/JavaScript
1
Install the SDK
Install the Podium SDK using your preferred package manager:
terminal
npm install @podiumcommerce/node-sdk
# or with yarn
yarn add @podiumcommerce/node-sdk
# or with bun
bun add @podiumcommerce/node-sdk2
Configure your API key
Create a client instance with your API key. The SDK automatically detects the environment based on your key prefix:
podium_test_*→ Staging APIpodium_live_*→ Production API
lib/podium.ts
import { createPodiumClient } from '@podiumcommerce/node-sdk'
// Option 1: Pass the API key directly
const client = createPodiumClient({
apiKey: 'podium_live_your-api-key',
})
// Option 2: Use environment variable
// Set PODIUM_API_KEY in your .env file
const client = createPodiumClient()3
List products
Make your first API call to list available products:
app.ts
const products = await client.product.list({
page: 1,
limit: 20,
})
console.log(products)
// {
// data: [{ id: '...', title: '...', price: 29.99, ... }],
// total: 150,
// page: 1
// }4
Create a user
Create a user account to enable ordering:
app.ts
const user = await client.user.create({
requestBody: {
email: 'customer@example.com',
privyId: 'did:privy:xxx', // From Privy auth
},
})
console.log(user.id) // 'user_abc123'5
Place an order
Create an order for the user with a product:
app.ts
const order = await client.userOrder.create({
id: user.id,
requestBody: {
productId: 'product_xyz',
quantity: 1,
},
})
console.log(order)
// { id: 'order_...', status: 'pending', items: [...] }6
Handle errors
Use the ApiError class for proper error handling:
app.ts
import { ApiError } from '@podiumcommerce/node-sdk'
try {
const products = await client.product.list({ page: 1 })
} catch (error) {
if (error instanceof ApiError) {
console.error(`API Error ${error.status}: ${error.message}`)
console.error('Response:', error.body)
}
throw error
}Next Steps
Available Namespaces
The SDK provides typed namespaces for all API areas:
client.productclient.userclient.userOrderclient.userOrdersclient.merchantclient.merchantProductsclient.merchantOrdersclient.merchantPayoutsclient.nftclient.userNfTsclient.tokenPresalesclient.campaignsclient.searchclient.agenticclient.categoriesSee the full list of 64+ namespaces in the API documentation.
