Skip to main content

Broker Connection

Code snippets to connect to your broker

Code snippets to connect to your broker

Pact

Pactflow

Pact JS (Node JS)

const { Verifier } = require("@pact-foundation/pact");

return new Verifier().verifyProvider({
provider: "<Your provider name here>",
providerBaseUrl: "http://localhost:8081",

// Fetch pacts from broker
pactBrokerUrl: "https://<YOUR_BROKER>.pactflow.io/",
pactBrokerToken: "<TOKEN>",

publishVerificationResult: process.env.CI === "true",
providerVersion: process.env.GIT_COMMIT,
});

Pactflow

Pact JS (Node JS)

const { Verifier } = require("@pact-foundation/pact");

return new Verifier().verifyProvider({
provider: "<Your provider name here>",
providerBaseUrl: "http://localhost:8081",

// Fetch pacts from broker
pactBrokerUrl: "https://<YOUR_BROKER>.pactflow.io/",
pactBrokerToken: "<TOKEN>",

publishVerificationResult: process.env.CI === "true",
providerVersion: process.env.GIT_COMMIT,
});