Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@bagdock/sdk

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bagdock/sdk

Official Bagdock API client for Node.js, Deno, Bun, and Cloudflare Workers

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source
  ----++                                ----++                    ---+++     
  ---+++                                ---++                     ---++      
 ----+---     -----     ---------  --------++ ------     -----   ----++----- 
 ---------+ --------++----------++--------+++--------+ --------++---++---++++
 ---+++---++ ++++---++---+++---++---+++---++---+++---++---++---++------++++  
----++ ---++--------++---++----++---++ ---++---++ ---+---++     -------++    
----+----+---+++---++---++----++---++----++---++---+++--++ --------+---++   
---------++--------+++--------+++--------++ -------+++ -------++---++----++  
 +++++++++   +++++++++- +++---++   ++++++++    ++++++    ++++++  ++++  ++++  
                     --------+++                                             
                       +++++++                                               

@bagdock/sdk

The official TypeScript SDK for the Bagdock API — manage facilities, contacts, tenancies, invoices, marketplace listings, loyalty programs, and IoT devices from any Node.js, Deno, Bun, or Cloudflare Workers environment.

npm version License: MIT

Install

npm install @bagdock/sdk
yarn add @bagdock/sdk
pnpm add @bagdock/sdk
bun add @bagdock/sdk

Quick start

import { Bagdock } from '@bagdock/sdk'

const bagdock = new Bagdock({
  apiKey: process.env.BAGDOCK_API_KEY!,
})

// List operator facilities
const facilities = await bagdock.operator.facilities.list({
  page: 1,
  per_page: 20,
})

// Create a contact
const contact = await bagdock.operator.contacts.create({
  email: 'jane@example.com',
  first_name: 'Jane',
  last_name: 'Doe',
})

// Search marketplace locations
const locations = await bagdock.marketplace.locations.search({
  city: 'London',
  size: 'medium',
})

API reference

bagdock.operator

MethodDescription
facilities.list(params?)List facilities
facilities.get(id)Get a facility
facilities.create(data)Create a facility
contacts.list(params?)List contacts
contacts.get(id)Get a contact
contacts.create(data)Create a contact
companies.list(params?)List companies
listings.list(params?)List listings
listings.publish(id)Publish a listing
tenancies.list(params?)List tenancies
tenancies.terminate(id, data)Terminate a tenancy
units.list(params?)List units
invoices.list(params?)List invoices
invoices.send(id)Send an invoice
invoices.markPaid(id, data?)Mark an invoice as paid
payments.list(params?)List payments
payments.refund(id, data?)Refund a payment
subscriptions.list(params?)List subscriptions
subscriptions.cancel(id, data?)Cancel a subscription
orders.list(params?)List orders
orders.fulfill(id)Fulfill an order

bagdock.marketplace

MethodDescription
locations.search(params?)Search locations by city, size, features
locations.get(id)Get a location
listings.list(params?)List marketplace listings
vendors.list(params?)List vendors
vendors.register(data)Register a vendor
rentals.create(data)Create a rental
rentals.get(id)Get a rental
availability.check(params)Check unit availability
sync.trigger(data)Trigger a marketplace sync

bagdock.loyalty

MethodDescription
members.create(data)Create a loyalty member
members.get(id)Get a member
points.balance(memberId)Get points balance
points.award(data)Award points
points.redeem(data)Redeem points
rewards.list(params?)List rewards
rewards.claim(data)Claim a reward
referrals.create(data)Create a referral

bagdock.iot

MethodDescription
devices.list(params?)List IoT devices
devices.register(data)Register a device
readings.list(params?)List sensor readings
readings.submit(data)Submit a reading
alerts.list(params?)List alerts
alerts.acknowledge(id)Acknowledge an alert

bagdock.webhooks

MethodDescription
verifySignature(body, sig, ts, secret)Verify a webhook HMAC signature
constructEvent(body, sig, ts, secret)Parse and verify a webhook event

Error handling

import { Bagdock, BagdockApiError } from '@bagdock/sdk'

try {
  await bagdock.operator.contacts.get('con_nonexistent')
} catch (err) {
  if (err instanceof BagdockApiError) {
    console.error(`API error ${err.status}: ${err.code}${err.message}`)
    console.error(`Request ID: ${err.requestId}`)
  }
}

Configuration

OptionTypeDefaultDescription
apiKeystringRequired. Your Bagdock API key
baseUrlstringhttps://api.bagdock.com/api/v1API base URL
timeoutnumber30000Request timeout in ms
maxRetriesnumber2Max retry attempts for transient errors

License

MIT — see LICENSE

Keywords

bagdock

FAQs

Package last updated on 16 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts