npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

gohl

v1.0.1

Published

Go Highlevel Node Js ease of use library implementation to their API

Downloads

77

Readme

A Node JS Go High Level API Wrapper

Static Badge Static Badge Static Badge Static Badge Static Badge

Go Highlevel Node Js ease of use library implementation to their API. Make sure you've create a Go Highlevel App in the Market Place

Brief Overview of the Library GHL APP

We recommend that you glance over the official Go Highlevel Documentation. We have tried to make the library have a corresponding function for each endpoint. Enjoy the intellisense!

Brief Overview of the Library GHL using API Key

We recommend that you glance over the official Go Highlevel Documentation. We have tried to make the library have a corresponding function for each endpoint. Enjoy the intellisense!

Initialization

import { Gohighlevel } from 'gohl'; // const { Gohighlevel } = require('gohl');

// Create Instance of Gohighlevel

// if you want to use the OAuth Way
const GHL = new Gohighlevel({
    // App Info from GHL Market Place
    clientId: process.env.CLIENT_ID,
    clientSecret: process.env.CLIENT_ID_SECRET,
    redirectUri: process.env.REDIRECT_URI,
    
    isWhiteLabel: true,
    scopes: ["contacts.readonly", "contacts.write", "locations.readonly"]
})

// Or if you just want to an API Key
// How to get API Key - https://www.youtube.com/watch?v=Blr6jTYP3nM&t=3s&pp=ygUeaG93IHRvIGdldCBnb2hpZ2hsZXZlbCBhcGkga2V5
const GHL = new Gohighlevel({ apiKey: process.env.GOHIGHLEVEL_API_KEY })

OAuth URL for GHL App

// use the scopes when initializing -> new Gohighlevel({ ... })
let url = GHL.oauth.getOAuthURL()
    
// or if you want to add scopes this way
url = GHL.oauth
    // you can add the necessary scopes for your 
    // using the Builder Design Pattern
    .scopeBusinessesReadonly()
    .scopeBusinessesWrite()
    .scopeCalendarsReadonly()
    .scopeCalendarsEventsWrite()

    // get the oauth URL
    .getOAuthURL()

OAuth Callback for GHL App

async function callback(req, res){
   // Get Auth Info
   const code = req.query.code;
   const refresh_token = req.query.refresh_token;
   const authInfo = await GHL.oauth.getCallbackAuthTokens({
        code: code,
        refresh_token: refresh_token
    });

   // log token values 
   console.log(authInfo.access_token, authInfo.refresh_token, authInfo.expires_in)
   
   // Set Auth Info
   GHL.setAuth(authInfo);
}

Use the API i.e Getting Contacts

// Use GHL API
// Corresponse with the endpoint
// For GHL APP - https://highlevel.stoplight.io/docs/integrations/ab55933a57f6f-get-contacts
// For GHL API KEY - https://public-api.gohighlevel.com/#0097b747-33c2-452f-8c78-aab5ab36c071
const contacts = GHL.contacts.search("Martin")
console.log(contacts);

Available Features and Examples

Contact Management

// Search Contacts
// Docs: https://highlevel.stoplight.io/docs/integrations/ab55933a57f6f-get-contacts
const contacts = await GHL.contacts.search("Martin");

// Add Contact
// Docs: https://highlevel.stoplight.io/docs/integrations/a06c8532146af-create-contact
const newContact = await GHL.contacts.create({
    email: "[email protected]",
    firstName: "John",
    lastName: "Doe"
});

// Contact Tasks
// Docs: https://highlevel.stoplight.io/docs/integrations/d839f4b0844d7-get-contact-tasks
const tasks = await GHL.contacts.tasks.get(contactId);

// Contact Notes
// Docs: https://highlevel.stoplight.io/docs/integrations/d0d7d4e495aeb-get-contact-notes
const notes = await GHL.contacts.notes.get(contactId);

Calendar and Appointments

// Get Calendar Events
// Docs: https://highlevel.stoplight.io/docs/integrations/7bfd74c6d24ac-get-calendar-events
const events = await GHL.calendar.events.get();

// Create Calendar Event
// Docs: https://highlevel.stoplight.io/docs/integrations/dd1a58077c131-create-calendar-event
const event = await GHL.calendar.events.create({
    title: "Meeting",
    startTime: "2024-03-20T10:00:00Z",
    endTime: "2024-03-20T11:00:00Z"
});

// Get Calendar Resources
// Docs: https://highlevel.stoplight.io/docs/integrations/0e4b5a8d8e5d4-get-calendar-resources
const resources = await GHL.calendar.resources.get();

Conversations and Messaging

// Get Conversations
// Docs: https://highlevel.stoplight.io/docs/integrations/b3A6MjU2NzI2Nzc-get-conversations
const conversations = await GHL.conversations.get();

// Send Message
// Docs: https://highlevel.stoplight.io/docs/integrations/b3A6MjU2NzI2ODM-send-message
const message = await GHL.conversations.messages.send({
    type: "text",
    contactId: "contact_id",
    message: "Hello!"
});

Products and Pricing

// Get Products
// Docs: https://highlevel.stoplight.io/docs/integrations/c2d2b7f816633-get-products
const products = await GHL.products.get();

// Create Product
// Docs: https://highlevel.stoplight.io/docs/integrations/cdf1c0c5c8116-create-product
const product = await GHL.products.create({
    name: "Product Name",
    price: 99.99
});

Custom Fields and Menus

// Get Custom Fields
// Docs: https://highlevel.stoplight.io/docs/integrations/7c20614981ad5-get-custom-fields
const fields = await GHL.customFields.get();

// Create Custom Menu
// Docs: https://highlevel.stoplight.io/docs/integrations/b5c2648a89c23-create-custom-menu
const menu = await GHL.customMenus.create({
    name: "My Menu",
    link: "https://example.com"
});

Opportunities and Pipeline

// Get Opportunities
// Docs: https://highlevel.stoplight.io/docs/integrations/b3A6MjU2NzI3MjU-get-opportunities
const opportunities = await GHL.opportunities.get();

// Create Pipeline
// Docs: https://highlevel.stoplight.io/docs/integrations/b3A6MjU2NzI3Mjg-create-pipeline
const pipeline = await GHL.opportunities.pipelines.create({
    name: "Sales Pipeline"
});

SaaS and Snapshots

// Get Locations
// Docs: https://highlevel.stoplight.io/docs/integrations/b3A6MjU2NzI3NDQ-get-locations
const locations = await GHL.saas.getLocations();

// Create Snapshot
// Docs: https://highlevel.stoplight.io/docs/integrations/b3A6MjU2NzI3NDc-create-snapshot
const snapshot = await GHL.snapshots.create({
    name: "Backup 2024"
});

Email Verification

// Verify Email
// Docs: https://highlevel.stoplight.io/docs/integrations/47a095a7cf1af-email-verification
const verification = await GHL.email.verify({
    email: "[email protected]"
});

Business and Company Management

// Get Business Details
// Docs: https://highlevel.stoplight.io/docs/integrations/b3A6MjU2NzI2NTU-get-business
const business = await GHL.businesses.get();

// Update Company
// Docs: https://highlevel.stoplight.io/docs/integrations/b3A6MjU2NzI2NTg-update-company
const company = await GHL.company.update({
    name: "New Company Name"
});

Support

You can support us with any amount. It's all appreciated.