0.45.0 • Published 5 months ago

bam-ticketing-sdk v0.45.0

Weekly downloads
-
License
ISC
Repository
-
Last release
5 months ago

BAM Ticketing SDK

SDK library for B.A.M Ticketing API.

Installation

npm i bam-ticketing-sdk

Usage

Create the main service object:

import { BAM } from  'bam-ticketing-sdk';

// Production API by default

// For development, use new BAM('https://develop.bam.fan');
const bam =  new BAM();

// Set the appropriate organizer name
// NOTE: This is not needed for `bam.account` and `bam.auth` calls
await bam.useOrganizer('org1');

// List all events with ticket configurations and occurrences
const events =  await bam.event
.listEvents({
	with: {
		ticket_config:  true,
		occurrence:  true
	}
});

// Get single event with all details (occurrences, timeslot, ticket configurations, discounts, ...)
const singleEvent =  await bam.event.getEvent({ id:  1234 })

// Create an order with 3 tickets
await bam.order.createOrder({
	format:  'PDF',
	orderItem: [{
		quantity:  3,
		ticketConfigId:  12345
	}]
});

Authentication

BAM Ticketing API uses JWT based authentication and authorization. The account/v1/auth/login is used for users (or services) with credentials, i.e. username and password.

BAM SDK uses a global method for any type of authentication with authorize. After calling this method, the internal HTTP client updates the authorization headers and successive calls will use the resolved JWT from BAM's API.

import { BAM } from  'bam-ticketing-sdk';
const bam = new BAM();

// Authorize with username and password
// Permissions are based on the account and are loaded into the instance
await bam.authorize({ username: 'admin', password: 'S3cret123' });

// Log in as guest user with a short-living guest JWT
await bam.authorize();

Reference

The BAM instance contains all properties and methods for authorization, users, events, orders and tickets.

Constructor

Create a new BAM instance.

BAM(url: 'http://api.bam.fan', version: 'v1')

Properties

PropertyDescription
accountUser, organizer and account management
authAuthorization endpoints
blockchainWallet signing operations
eventEvent management
identymeIdentyme integration operations
orderOrder, order contact and ticket management
paymentPayment providers operations
venueVenue information and search

License

ISC

0.44.0

5 months ago

0.45.0

5 months ago

0.40.3

6 months ago

0.41.0

6 months ago

0.37.0

9 months ago

0.33.1

1 year ago

0.31.0

1 year ago

0.30.0

1 year ago

0.29.0

1 year ago

0.28.0

1 year ago

0.29.1

1 year ago

0.28.2

1 year ago

0.27.0

1 year ago

0.26.0

1 year ago

0.23.1

2 years ago

0.22.0

2 years ago

0.21.0

2 years ago

0.20.1

2 years ago

0.20.0

2 years ago

0.20.2

2 years ago

0.19.0

2 years ago

0.16.0

2 years ago

0.15.1

2 years ago

0.14.3

2 years ago

0.14.4

2 years ago

0.14.1

2 years ago

0.14.0

2 years ago

0.11.0

2 years ago

0.10.0

2 years ago

0.9.0

2 years ago

0.8.1

3 years ago

0.8.0

3 years ago

0.7.1

3 years ago

0.8.2

2 years ago

0.6.1

3 years ago

0.5.3

3 years ago

0.6.0

3 years ago

0.5.0

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.3.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago