New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@unchainedshop/ticketing

Package Overview
Dependencies
Maintainers
2
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unchainedshop/ticketing

Event ticketing extension for the Unchained Engine with PDF and wallet pass support

latest
Source
npmnpm
Version
4.8.10
Version published
Maintainers
2
Created
Source

npm version License: EUPL-1.2

@unchainedshop/ticketing

Event ticketing extension for the Unchained Engine. Provides PDF ticket generation, Apple Wallet passes, Google Wallet passes, and magic key order access.

Installation

npm install @unchainedshop/ticketing

Usage

import { startPlatform } from '@unchainedshop/platform';
import setupTicketing, { ticketingModules, ticketingServices } from '@unchainedshop/ticketing';
import { connect } from '@unchainedshop/api/express';

const app = express();

const engine = await startPlatform({
  modules: ticketingModules,
  services: ticketingServices,
});

connect(app, engine, { corsOrigins: [] });

// Setup ticketing with your renderers
setupTicketing(engine.unchainedAPI, {
  renderOrderPDF,
  createAppleWalletPass,
  createGoogleWalletPass,
});

API Overview

Setup Functions

ExportDescription
setupTicketingInitialize ticketing with all renderers
setupPDFTicketsSetup only PDF rendering
setupMobileTicketsSetup only wallet passes

Modules

ExportDescription
ticketingModulesAdditional modules for ticketing
ticketingServicesAdditional services for ticketing

Server Adapters

Import PathDescription
@unchainedshop/ticketing/expressExpress route handlers
@unchainedshop/ticketing/fastifyFastify route handlers

Renderer Types

TypeDescription
ORDER_PDFPDF ticket/receipt rendering
APPLE_WALLETApple Wallet pass generation
GOOGLE_WALLETGoogle Wallet pass generation

Types

ExportDescription
TicketingAPITicketing API context type
TicketingModuleModule interface type
TicketingServicesServices interface type
RendererTypesRenderer type constants

Apple Wallet Setup

  • Add a new Pass Type ID on developer.apple.com, then generate a production certificate. Download and import into Keychain.

  • Export with Keychain: Select "Certificates" tab, select the Pass Type ID, select both ID and key, export in p12 format.

  • Convert to PEM (set a PEM passphrase as required):

openssl pkcs12 -in Certificates.p12 -legacy -clcerts -out cert_and_key.pem
  • Configure via environment variables:
PASS_CERTIFICATE_PATH=./cert_and_key.pem
PASS_CERTIFICATE_SECRET=YOUR_PEM_PASSPHRASE
PASS_TEAM_ID=SSCB95CV6U

Renderer Implementation

PDF Renderer

import React from 'react';
import ReactPDF, { Document } from '@react-pdf/renderer';

const TicketTemplate = ({ tickets }) => (
  <Document>
    {/* Your ticket layout */}
  </Document>
);

export default async ({ orderId, variant }, { modules }) => {
  const order = await modules.orders.findOrder({ orderId });
  // ... prepare data
  return ReactPDF.renderToStream(<TicketTemplate tickets={tickets} />);
};

Apple Wallet Renderer

import { Template, constants } from '@walletpass/pass-js';

export default async (token, unchainedAPI) => {
  const template = new Template('eventTicket', /* ... */);
  const pass = await template.createPass(/* ... */);
  return pass;
};

Google Wallet Renderer

import { google } from 'googleapis';
import jwt from 'jsonwebtoken';

export default async (token, unchainedAPI) => {
  // Upsert class and object
  const asURL = async () => createJwtNewObjects(issuerId, productId, token.tokenSerialNumber);
  return { asURL };
};

Magic Key Order Access

Allow users to access orders and tickets without logging in via a one-time magic key:

// Generate magic key
const magicKey = await modules.passes.buildMagicKey(orderId);

// Use in URL: https://my-shop/:orderId?otp=:magicKey
// Send via x-magic-key HTTP header for API access

Protected actions: viewOrder, updateToken, viewToken

Environment Variables

VariableDescription
UNCHAINED_SECRETRequired for magic key encryption
PASS_CERTIFICATE_PATHPath to Apple pass certificate
PASS_CERTIFICATE_SECRETPEM passphrase
PASS_TEAM_IDApple Developer Team ID

License

EUPL-1.2

Keywords

unchained

FAQs

Package last updated on 01 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