This is not the lefthook Git hooks tool. Left Hook SDK is the Frigg integration framework from Left Hook — unrelated to Evil Martians'lefthook Git hooks package.
Left HookSDKQuickstart
Left Hook SDK quickstart
Four commands and one class stand between an empty directory and an integration that imports, registers an API module, and answers an HTTP route. The SDK is @friggframework/core, the CLI is @friggframework/devtools, and both build on Frigg.
1. Install the SDK
The next tag is the Frigg 2.x line the scaffold pins; latest is 1.x and has different exports.
Terminal
npm install @friggframework/core@next2. Scaffold the app
--yes accepts every default, including running npm install. Use Node ^20.19, ^22.13 or >=24: the serverless runtime the scaffold pins refuses other versions, including 23. The third line installs an API module, writes src/integrations/HubSpotIntegration.js and lists it in index.js. It also prints the four OAuth variables that module needs (HUBSPOT_CLIENT_ID, HUBSPOT_CLIENT_SECRET, HUBSPOT_SCOPE, REDIRECT_URI) — add them to .env before you connect an account — the app boots without them, the OAuth round trip does not.
Terminal
npx @friggframework/devtools@next init my-integration --yes
cd my-integration
npx frigg install hubspot3. The integration, in full
One file, and every name in it is real: the base class is IntegrationBase, and an API module exports Api and Definition (HubSpot also exports Config and extensions). The module key matches this.hubspot, and the handler name in the binding must be a method on the class.
The trigger is the module's webhook extension, not a hand-written route. That matters for more than brevity: a custom Definition.routes handler runs with no auth middleware and no connected account, so a route that took an integration id and read a portal would answer anyone who guessed the id. The extension instead verifies HubSpot's v3 signature, resolves the portal to its own integration record, and only then calls your method on a hydrated instance.
src/integrations/HubSpotIntegration.js
// src/integrations/HubSpotIntegration.js
// `npx frigg install hubspot` writes this file and adds it to index.js;
// the extension binding and the handler are the part you write.
const { IntegrationBase, createFriggCommands } = require('@friggframework/core');
const hubspot = require('@friggframework/api-module-hubspot');
class HubSpotIntegration extends IntegrationBase {
static Definition = {
name: 'hubspot',
version: '1.0.0',
supportedVersions: ['1.0.0'],
hasUserConfig: false,
display: {
label: 'HubSpot',
description: 'React to HubSpot contact events.',
category: 'CRM',
},
// The module's `Definition` becomes `this.hubspot` on the instance.
modules: {
hubspot: { definition: hubspot.Definition },
},
// Trigger: HubSpot POSTs to /api/hubspot-integration/hubspotWebhooks/webhooks.
// The module's extension checks the v3 signature and resolves the portal to
// its integration before your handler runs, so no route is written here.
extensions: {
hubspotWebhooks: {
extension: hubspot.extensions.webhooks,
handlers: { HUBSPOT_WEBHOOK: 'onHubSpotEvent' },
},
},
};
constructor(params) {
super(params);
// Required: the receiver resolves portalId -> integration through commands.
this.commands = createFriggCommands({ integrationClass: HubSpotIntegration });
}
// Action: a hydrated instance, with this.hubspot.api for that one portal.
async onHubSpotEvent({ data }) {
const { subscriptionType, objectId } = data.body;
if (subscriptionType !== 'contact.creation') {
return { skipped: subscriptionType };
}
await this.hubspot.api.updateContact(objectId, { lifecyclestage: 'lead' });
return { updated: objectId };
}
}
module.exports = HubSpotIntegration;4. Run it
frigg start checks the database before it boots, so create the throwaway Postgres first: the scaffold's .env points at postgresql://postgres:postgres@localhost:5432/frigg and a fresh postgres:16 container has no frigg database without POSTGRES_DB. It also creates its SQS queues in LocalStack at http://localhost:4566, or at AWS_ENDPOINT if you point that at real AWS, so LocalStack has to be up. npm start prints the local URL — http://localhost:3001 — once both containers are up. The receiver is mounted at /api/hubspot-integration/hubspotWebhooks/webhooks — locally that is enough to see the app boot with the module wired; for real HubSpot deliveries, register a deployed stage's URL as the app's webhook target and set HUBSPOT_CLIENT_SECRET, which is what the signature check reads.
Terminal
docker run --name frigg-postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=frigg -p 5432:5432 -d postgres:16
docker run --name frigg-localstack -p 4566:4566 -d localstack/localstack:3
npm run db:setup
npm startWhere to go next
- Frigg Framework overview — what the runtime, the CLI and the app definition do.
- docs.friggframework.org — app-definition reference, API module catalog, deployment options.
- Book a call — if you would rather we build the first connector with you.