Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

You can exercise Relay’s delivery-task workflow from Node.js without dispatching a real rider or making a real payment: use a test key and the tutorial’s simulation settings. The sample creates a task with a pickup and a drop-off, then returns an ID your application can retain for later status checks. A successful response means Relay accepted the task for processing—not that delivery is complete.

What you’ll create

Relay describes its developer API as a way to create and manage delivery tasks, then keep an application synchronized through lifecycle events and rider tracking. Its developer page says: “Create and manage delivery tasks with a REST API, then keep your app in sync with WebSocket tracking and webhooks.” Relay’s developer page describes those capabilities; this guide focuses on creating one simulated task, not implementing update listeners.

The tutorial’s example contains two stages: a PICKUP with location and parcel details, followed by a DROPOFF at the destination. It also sets simulationOutcome: 'SUCCESS' and autoAssign: true, and supplies an idempotency key in the SDK call options. These are the tutorial’s example values, not independently tested code or evidence of a real dispatch.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set up Node.js and test access

The Relay tutorial uses the @relay-sdk/sdk-node package and runs a script with node. Its indexed excerpt states that Node 18 or newer is required, but that runtime requirement and the package’s current version have not been independently confirmed against live documentation. Check Relay’s current developer documentation before relying on those details.

  1. Create a Relay account and obtain a test key through Relay’s developer access flow. The available tutorial excerpt does not establish the current key-issuance steps.
  2. Keep the key on your server. Store it in an environment variable rather than putting it in browser code, committing it to source control, or embedding it in a shared script.
  3. Install @relay-sdk/sdk-node in your Node project using the package instructions currently provided by Relay. The current package version and exact installation command are not confirmed here.
  4. Put the example in a server-side Node script and run it with node after configuring the test key. Do not substitute a production credential when your goal is simulation.

Prepare the pickup and drop-off payload

Use the tutorial’s task structure as a model: describe a pickup stage with a location and parcel details, then a drop-off stage with its destination. The tutorial includes Lagos addresses and coordinates as demonstration inputs only; they do not establish Relay service coverage in Lagos or any other location. Its estimatedValue is a declared parcel value in kobo, not a delivery quote.

The tutorial’s example also requests a simulated successful outcome and automatic assignment. Keep those settings in the test workflow; the tutorial characterizes this path as simulated processing, with no real rider or real payment involved. The precise payload schema can change, so check the current SDK documentation for required field names and accepted values before adapting the example to an application.

Create the simulated task and retain its ID

Call the SDK’s task-creation operation with the pickup and drop-off stages, the tutorial’s simulation settings, and an idempotency key in the call options. The example prints the returned task ID and initial status. Because the exact method signature and schema have not been independently verified against current documentation, treat the tutorial as the reference for those details rather than assuming an unverified snippet will run unchanged.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When creation succeeds, associate the returned task ID with the corresponding order or delivery record in your application. Keep it alongside your own order identifier so a later status lookup or update can be matched to the right customer transaction. The initial status is only a snapshot: task acceptance is not proof that delivery has finished.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What test mode does—and does not—tell you

  • It lets you exercise the task-creation integration using a test key and simulation without involving a real rider or real payment, as described by the tutorial.
  • It does not establish that a real delivery can be dispatched to the sample address, that the address is in a supported service area, or what a real delivery would cost.
  • It does not validate your production credentials, live operational workflow, or the implementation of webhooks and WebSocket tracking.

Relay’s developer page identifies lifecycle events, webhooks, and WebSocket tracking as ways to keep an application synchronized. This creation walkthrough does not specify event names, connection details, or a subscription implementation, so consult Relay’s current documentation before building those parts.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.