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 🙏

© 2026 – Pkg Stats / Ryan Hefner

igolf-sdk

v1.0.9

Published

SDK for interacting with the iGolf API (JavaScript & TypeScript compatible)

Downloads

27

Readme

igolf-sdk

igolf-sdk is a TypeScript SDK for securely interacting with the iGolf API. It provides a clean, typed interface for making authenticated requests using HMAC-SHA256 signatures.

Features

  • HMAC-SHA256-based signature authentication
  • Timestamped and signed URL generation
  • Easy-to-use HTTP POST interface
  • Written in TypeScript with full type support
  • Clean, promise-based API

Installation

npm install igolf-sdk

🚀 Quick Start

TypeScript

import { IGolfController, IgolfConfig } from "igolf-sdk";

const config: IgolfConfig = {
  baseUrl: "https://api.igolf.com",
  appKey: "your_app_key",
  apiVersion: "1.0",
  signVersion: "1.0",
  signMethod: "HMAC-SHA256",
  appSecret: "your_app_secret",
};

const igolf = new IGolfController(config);

async function fetchUserData() {
  const actionCode = "CourseList";
  const params = {
    referenceLatitude: 40.71,
    referenceLongitude: -74.0,
    radius: 50,
    page: 2,
  };

  const response = await igolf.requestWithActionCode(actionCode, params);

  if (response.stat) {
    console.log("Success:", response.data);
  } else {
    console.error("Error:", response.data);
  }
}

JavaScript

const { IGolfController } = require("igolf-sdk");

const config = {
  baseUrl: "https://api.igolf.com",
  appKey: "your_app_key",
  apiVersion: "1.0",
  signVersion: "1.0",
  signMethod: "HMAC-SHA256",
  appSecret: "your_app_secret",
};

const igolf = new IGolfController(config);

async function fetchUserData() {
  const actionCode = "CourseList";
  const params = {
    referenceLatitude: 40.71,
    referenceLongitude: -74.0,
    radius: 50,
    page: 2,
  };

  const response = await igolf.requestWithActionCode(actionCode, params);

  if (response.stat) {
    console.log("Success:", response.data);
  } else {
    console.error("Error:", response.data);
  }
}

fetchUserData();

🧩 API Reference

IGolfController

A class to interact with the iGolf API using signed HTTP POST requests.

Constructor

new IGolfController(config: IgolfConfig)

Parameters

config: An object with the following properties:

| Field | Type | Description | | ----------- | ------ | ------------------------------------------------ | | baseUrl | string | Base iGolf API URL (e.g., https://api.igolf.com) | | appKey | string | Your API key | | apiVersion | string | API version, e.g. "1.0" | | signVersion | string | Signature version, e.g. "1.0" | | signMethod | string | Signature method (must be "HMAC-SHA256") | | appSecret | string | Your app's secret key |

Method: requestWithActionCode

Sends a signed request to the iGolf API for a given action.

requestWithActionCode<T>(
  actionCode: string,
  params: Record<string, any>
): Promise<ApiResponse<T>>
controller
  .requestWithActionCode("SomeAction", { key: "value" })
  .then((response) => {
    if (response.stat) {
      console.log("Success:", response.data);
    } else {
      console.error("Error:", response.data);
    }
  });

Parameters

  • actionCode (string): The specific API action, e.g. "GetUserData"
  • params (object): The request body parameters as key-value pairs

IgolfConfig

Configuration object used to initialize the SDK.

TypeScript Example

interface IgolfConfig {
  baseUrl: string;
  appKey: string;
  apiVersion: string;
  signVersion: string;
  signMethod: string;
  appSecret: string;
}

JavaScript Example

const config = {
  baseUrl: "https://api.igolf.com",
  appKey: "your_app_key",
  apiVersion: "1.0",
  signVersion: "1.0",
  signMethod: "HMAC-SHA256",
  appSecret: "your_app_secret",
};

ApiResponse

Generic wrapper for API responses.

interface ApiResponse<T> {
  stat: boolean;
  data: T | string;
}
  • stat: Indicates whether the request was successful
  • data: Either the response data or a string error message

🛡 Security

NEVER commit your real app keys or app secret tokens to version control.
Always protect your private keys with file system permissions.

📝 License

MIT

📬 Author & Support

Mayank Anand
Email: [email protected]

npm npm