| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This quickstart uses the current PassKit TypeScript gRPC SDK and follows the flows in PassKit's Node and Java quickstarts.
It demonstrates how to:
Put the following credentials in certs/:
Update the API region in config/config.ts. Use grpc.pub1.passkit.io for Europe or grpc.pub2.passkit.io for the US.
Install dependencies. The latest SDK commit is currently ahead of npm, so it is pinned to its GitHub source archive and built automatically during installation.
npm installTo run flights, provide the identifier of an Apple pass certificate already uploaded to PassKit:
export PASSKIT_APPLE_CERTIFICATE='pass.com.your-airline'Supply the private-key passphrase and run all four quickstarts:
PASSKIT_PASSPHRASE='your-passphrase' npm run devRun one quickstart at a time with --quickstart:
npm run dev -- --quickstart loyalty
npm run dev -- --quickstart coupons
npm run dev -- --quickstart event-tickets
npm run dev -- --quickstart flightsThe examples delete the resources they create after completing. Pass --keep if you want to inspect them in your PassKit account:
npm run dev -- --quickstart loyalty --keepThe repository builds and runs in both module formats. You do not need to edit imports or change package.json when switching—the npm script selects the appropriate build.
Use ESM:
npm run dev:esm -- --quickstart loyaltyUse CommonJS:
npm run dev:cjs -- --quickstart loyaltynpm run dev is an alias for dev:esm, so ESM is the default. The -- forwards subsequent options such as --quickstart and --keep to the quickstart.
First build both formats:
npm run buildThen select the format when starting:
# ESM
npm run start:esm -- --quickstart loyalty
# CommonJS
npm run start:cjs -- --quickstart loyaltynpm start is an alias for start:esm. To retain created PassKit resources, the same flags work with either format:
npm run start:esm -- --quickstart coupons --keep
npm run start:cjs -- --quickstart coupons --keepnpm run build:esm
npm run build:cjsThe ESM compiler uses tsconfig.esm.json and writes to dist/esm. The CommonJS compiler uses tsconfig.cjs.json and writes to dist/cjs. Each build script also writes a small package.json into the output directories so Node interprets their .js files correctly.
| Task | ESM | CommonJS |
|---|---|---|
| Develop/run | npm run dev:esm | npm run dev:cjs |
| Build | npm run build:esm | npm run build:cjs |
| Run built output | npm run start:esm | npm run start:cjs |
| Output | dist/esm | dist/cjs |
npm run build
npm startThe SDK uses Buf-generated message schemas. Create messages with create(Schema, initialValues). ConnectRPC supplies the gRPC transport and exposes server streams as async iterables.
| Back | FazBrowse Home | New Git URL |