This quickstart aims to help get NodeJs developers up and running with the PassKit SDK as quickly as possible.
You will need the following:
- A PassKit account (signup for free at https://app.passkit.com)
- Your PassKit SDK Credentials (available from the https://app.passkit.com/app/account/developer-tools)
- Nodejs 10 or above (https://nodejs.org/en/)
-
Download or clone this quickstart repository.
-
Create a new folder inside
src
calledcerts
and add the following three PassKit credential files into it. Files can be found in the sdk credentials email you receive on signup:- certificate.pem
- ca-chain.pem
- key.pem
-
Run
npm run openssl
and provide your account password in the terminal prompt. -
If you wish to receive enrolment emails, edit lines 281 and 307 of the QuickStartLoyalty class to provide an address where you can receive mail.
-
Run
npm i
Run npm run test
The Loyalty tests will create a membership program with 2 tiers, 1 member and two member events.
The tests will display URLs to the generated passes and to the enrolment page. It will pause for a period determined in the test file on line 64.
The tests will then delete and clean-up all assets that it created.
For implementing in your own projects, use the PassKitClient class to manage connection to the PassKit gRPC endpoints.
The quickstart uses the PassKit official node sdk found here: https://www.npmjs.com/package/passkit-node-sdk