Getting Started with HighLevel SDK
The official TypeScript/JavaScript SDK for HighLevel provides a comprehensive interface to interact with all HighLevel API endpoints with built-in authentication, error handling, and automatic token management.
Installation
You can install it directly from our GitHub repository:
- npm
- yarn
npm i @gohighlevel/api-client
yarn add @gohighlevel/api-client
Quick Start
Import and Initialize
- JavaScript
- TypeScript
const HighLevel = require('@gohighlevel/api-client');
const ghl = new HighLevel({
clientId: 'your_client_id_here',
clientSecret: 'your_client_secret_here'
});
import HighLevel from '@gohighlevel/api-client';
const ghl = new HighLevel({
clientId: 'your_client_id_here',
clientSecret: 'your_client_secret_here'
});
Authentication Methods
The SDK supports two primary authentication methods:
1. Private Integration Token (PIT)
const ghl = new HighLevel({
privateIntegrationToken: 'your_pit_token'
});
2. OAuth 2.0 Flow
Required for marketplace apps and public integrations:
const ghl = new HighLevel({
clientId: 'your_client_id',
clientSecret: 'your_client_secret'
});
Key Points:
- The SDK automatically handles authentication for each API call
- locationId or companyId is required to handle the automatic authentication
- SDK will auto refresh the token whenever it is expired
Examples
For practical examples and complete sample applications showing how to use the HighLevel SDK, check out our examples repository:
This repository contains:
- Complete Node.js applications with OAuth implementation
- Step-by-step guides for common use cases
- Best practices for SDK integration