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

@astroinsightapi/sdk

v1.0.0

Published

Official TypeScript/JavaScript SDK for Astro Insight API - Astrology, Panchang, Tarot, and Numerology services.

Readme

@astroinsightapi/sdk

NPM Version License

Official, strongly-typed Universal TypeScript & JavaScript SDK for the Astro Insight API. Works seamlessly in Node.js (v18+) and Browsers (React, Next.js, Vue, Angular, React Native) with zero external HTTP dependencies using the native fetch API.


Features

  • 🪐 Vedic Astrology: Ashtakvarga, Vimshottari / Char / Yogini Dashas, KP System, Jaimini, Lal Kitab, Varshaphal, Ghat Chakra, Horoscope Charts & Doshas.
  • 💍 Matchmaking: Guna Milan, Kundali Compatibility, Manglik Matching.
  • 🗓️ Panchang & Muhurta: Daily Panchang, Choghadiya, Hora, Shubh Muhurta timing.
  • 🔮 Western Astrology & Tarot: Natal Charts, Solar Return, Transits, Synastry, Tarot spreads (One-card, Three-card, Celtic Cross, Love, Career).
  • 🔢 Numerology: Vedic & Western Numerology (Life Path, Destiny, Soul Urge).
  • ☯️ Chinese Astrology & Biorhythm: Zodiac sign compatibility & biorhythm calculations.
  • 🌍 Geo Utilities: Place search, timezone lookup by coordinates or ID.
  • 📦 Dual Bundle Output: ESM (import) and CommonJS (require) with 100% complete TypeScript declaration files (.d.ts).

Installation

Install the package via npm, yarn, or pnpm:

npm install @astroinsightapi/sdk

Or with yarn / pnpm:

yarn add @astroinsightapi/sdk
# or
pnpm add @astroinsightapi/sdk

Quick Start

ESM / TypeScript / Next.js / React

import { AstroClient, BirthDetails } from '@astroinsightapi/sdk';

const client = new AstroClient({
  clientId: 'YOUR_CLIENT_ID',
  clientSecret: 'YOUR_CLIENT_SECRET',
});

const birth = new BirthDetails({
  day: 15,
  month: 8,
  year: 1995,
  hour: 10,
  min: 30,
  sec: 0,
  tzone: 5.5,
  lat: 28.6139,
  lon: 77.2090,
});

async function run() {
  // Fetch Birth Details
  const details = await client.vedic.astroDetails.getBirthDetails(birth);
  console.log(details.data.birth_details.day); // Tuesday

  // Fetch Sun Bhinnashtakavarga
  const ashtak = await client.vedic.ashtakvarga.getPlanetAshtak('sun', birth);

  // One Card Tarot Reading
  const tarot = await client.tarot.getOneCardReading();
}

run();

CommonJS / Node.js Express

const { AstroClient, BirthDetails } = require('@astroinsightapi/sdk');

const client = new AstroClient({
  clientId: 'YOUR_CLIENT_ID',
  clientSecret: 'YOUR_CLIENT_SECRET',
});

Code Examples

🪐 Vedic Astrology & Dashas

// Major Vimshottari Dasha
const dasha = await client.vedic.vimshottariDasha.getMajorDasha(birth);

// Gemstone Suggestions
const remedies = await client.vedic.suggestions.getGemstoneSuggestions(birth);

// Manglik Dosha Check
const manglik = await client.vedic.horoscopeDosha.getManglikDosha(birth);

💍 Matchmaking (Guna Milan)

import { MatchInput } from '@astroinsightapi/sdk';

const male = new BirthDetails({ day: 15, month: 8, year: 1995, hour: 10, min: 30 });
const female = new BirthDetails({ day: 20, month: 11, year: 1997, hour: 14, min: 15 });

const matchInput = new MatchInput({ male, female });

// Calculate Guna Milan
const score = await client.vedic.matchMaking.getGunaMilan(matchInput);

🗓️ Daily Panchang & Muhurta

const panchang = await client.vedic.panchang.getDailyPanchang(birth);
const choghadiya = await client.vedic.muhurta.getChoghadiya(birth);

🔮 Horoscope & Geo Services

// Daily Horoscope for Leo
const leoDaily = await client.horoscope.getDailyHoroscope('leo');

// Search Place Coordinates
const placeInfo = await client.geo.searchPlace('Delhi');

Dynamic Configuration & Headers

// Switch language dynamically
client.setLanguage('hi');

// Switch Ayanamsha system
client.setAyanamsha('raman');

Error Handling

import {
  AstroClient,
  BirthDetails,
  AuthenticationError,
  ValidationError,
  RateLimitError,
  AstroError,
} from '@astroinsightapi/sdk';

const client = new AstroClient({ clientId: 'YOUR_CLIENT_ID', clientSecret: 'YOUR_CLIENT_SECRET' });
const birth = new BirthDetails({ day: 15, month: 8, year: 1995, hour: 10, min: 30 });

try {
  const response = await client.vedic.astroDetails.getBirthDetails(birth);
} catch (error: any) {
  if (error instanceof AuthenticationError) {
    console.error('Auth failed:', error.message);
  } else if (error instanceof ValidationError) {
    console.error('Validation failed:', error.message, error.errors);
  } else if (error instanceof RateLimitError) {
    console.error('Rate limit exceeded. Retry later.');
  } else if (error instanceof AstroError) {
    console.error(`API Error [${error.statusCode}]:`, error.message);
  }
}

Building & Testing

# Install dependencies
npm install

# Build ESM & CommonJS bundles
npm run build

# Run live test script
node tests/test-live.js

License

This SDK is open-sourced software licensed under the MIT License.