1.26.0 • Published 9 months ago

@askeladden/booking-sdk v1.26.0

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

Booking SDK Documentation

Overview

The Booking SDK allows you to interact with the Booking Hasura GraphQL API seamlessly. This SDK is split into server-side and client-side implementations, enabling easy integration based on your needs.

Installation

Install the SDK via npm:

npm install @askeladden/booking-sdk

Setup

Server SDK

The server SDK can be set up with the following parameters:

ParameterTypeRequiredDefaultDescription
organizationIdstringYes-Your organization ID.
urlstringNohttps://booking-hasura.askeladden.co/v1/graphqlThe GraphQL API endpoint URL.
trackingEnabledbooleanNofalseEnable tracking by including cookies in the request.
import { getServerSdk } from '@askeladden/booking-sdk/server';

const serverSdk = getServerSdk({
  organizationId: 'your-organization-id',
  trackingEnabled: true,
});

// Example usage: CreateBookableEventRegistration
await serverSdk.CreateBookableEventRegistration({
  object: {
    // ...details
  },
});

API Client SDK

The API client SDK provides additional functions and requires OAuth2 authentication. You can generate API clients on booking.askeladden.co under settings.

ParameterTypeRequiredDefaultDescription
organizationIdstringYes-Your organization ID.
urlstringNohttps://booking-hasura.askeladden.co/v1/graphqlThe GraphQL API endpoint URL.
clientIdstringYes-Your client ID for OAuth2.
clientSecretstringYes-Your client secret for OAuth2.
import { getApiClientSdk } from '@askeladden/booking-sdk/server';

const apiClientSdk = getApiClientSdk({
  organizationId: 'your-organization-id',
  clientId: 'your-client-id',
  clientSecret: 'your-client-secret',
});

const result = await apiClientSdk.SomeQuery({
  // ...details
});

Client SDK

The client SDK can be set up with the following parameters:

ParameterTypeRequiredDefaultDescription
organizationIdstringYes-Your organization ID.
urlstringNohttps://booking-hasura.askeladden.co/v1/graphqlThe GraphQL API endpoint URL.
trackingEnabledbooleanNofalseEnable tracking by including cookies in the request.
import { getClientSdk } from '@askeladden/booking-sdk/client';

const clientSdk = getClientSdk({
  organizationId: 'your-organization-id',
  trackingEnabled: true,
});

// Example usage: CreateBookingRequest
await clientSdk.CreateBookingRequest({
  object: {
    // ...details
  },
});
1.26.0

9 months ago

1.25.0

10 months ago

1.25.1

10 months ago

1.24.0

11 months ago

1.15.0

1 year ago

1.14.0

1 year ago

1.19.0

1 year ago

1.18.0

1 year ago

1.17.0

1 year ago

1.16.0

1 year ago

1.21.0

1 year ago

1.22.0

1 year ago

1.21.1

1 year ago

1.20.0

1 year ago

1.23.0

1 year ago

1.13.0

1 year ago

1.12.2

1 year ago

1.12.1

1 year ago

1.12.0

1 year ago

1.11.0

1 year ago

1.10.0

1 year ago

1.9.0

1 year ago

1.8.0

1 year ago

1.7.1

1 year ago

1.7.0

1 year ago

1.6.0

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.2

2 years ago