This quickstart runs the same journey as the API-first integration quickstart, which makes each call with raw HTTP. Read the two side by side to see what the SDK does for you.
Before you start
Before running this quickstart, make sure you have:- An API client created in the Account management portal, which provides the client ID and client secret you use to authenticate. For instructions, see Manage API clients.
- Permission to create and publish journeys in the Journey builder.
- For TypeScript, Node.js 18 or later, and npm.
- For Java, JDK 11 or later, and Maven.
Step 1: Set up your journey
You need a published journey with the Age Verification module. Follow the steps in Option 2: Create a journey from scratch of the Platform quickstart to add the module to a journey and publish it.The program submits a name and a date of birth. Add only the Age Verification module, so that the journey doesn’t wait for anything else. A journey with more modules, for example document checks, stays in progress after the submit.
<resourceId>@<version>, for example:
Step 2: Create a project
- TypeScript
- Java
Create a folder for the quickstart, then install the SDK and
tsx, which runs TypeScript files directly:Step 3: Set your credentials
The program reads your credentials and journey from environment variables. Set them in the terminal you’ll run it from:Step 4: Write the program
- TypeScript
- Java
Create a file named
quickstart.ts in the project folder with this code:quickstart.ts
The fetch and state responses each arrive as one of three variants. Each is a full view, a slim view, or an unknown body, and the program checks which variant arrived before it reads any fields.
If your tenant is in the Americas or Australasia, then replace
eu in SERVER_URL with us or au.
Step 5: Run the program
- TypeScript
- Java
Run the program from the project folder:When the journey finishes, your output looks similar to this:
Troubleshooting
The token request returns HTTP 400 or 401
The token request returns HTTP 400 or 401
The client ID or client secret is wrong, or someone deleted the API client. Check the values in the Clients tab of the Account management portal, and set the environment variables again.
The start request returns HTTP 404
The start request returns HTTP 404
GBG Go can’t find the journey. Check that
JOURNEY_RESOURCE_ID includes the version, that you’ve published the journey, and that SERVER_URL names the region your tenant is in.Fetch or submit returns HTTP 401, but start succeeds
Fetch or submit returns HTTP 401, but start succeeds
The call is missing its security setting. In TypeScript, pass
{ interactionAccess: accessToken } as the first argument to interactions.fetch and interactions.submit. In Java, call .security() with interactionAccess(accessToken) on interactions().fetch() and interactions().submit().The program reports that the journey is still in progress
The program reports that the journey is still in progress
The journey is waiting for data the program doesn’t send, such as an address or a photo of a document. Open the journey instance in the Investigation portal to see which step it’s waiting at.Remove the extra modules from the journey and publish it again, or extend the submit call to send the data they need.
The program reports that no interaction became available
The program reports that no interaction became available
The journey didn’t present an interaction within 20 seconds. Open the journey instance in the Investigation portal to see which step it stopped at.
TypeScript: ConnectionError: fetch failed, or UNABLE_TO_GET_ISSUER_CERT_LOCALLY
TypeScript: ConnectionError: fetch failed, or UNABLE_TO_GET_ISSUER_CERT_LOCALLY
Node.js uses its own list of trusted certificate authorities, not your operating system’s. Behind a TLS-inspecting proxy, every request fails even though curl works.On Node.js 22.15 or later, run
export NODE_OPTIONS=--use-system-ca before you run the program. On older versions, set NODE_EXTRA_CA_CERTS to the path of your proxy’s root certificate.Next steps
- Core SDK: every resource and method the SDK exposes, with regions, retries, and error handling.
- TypeScript notes and Java notes: install details, runtime support, and language-specific features.
- Sample applications: working onboarding apps with a front end, on an API or SDK backend.
- API usage guides: detailed step-by-step reference for each call.