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

@entergreat/unipile-wrapper

v2.1.4

Published

A lightweight TypeScript wrapper for Unipile's LinkedIn API

Readme

Unipile Wrapper

Overview

A lightweight TypeScript wrapper for Unipile's social network automation platform. This wrapper simplifies the interaction with Unipile's API, currently focusing on LinkedIn automation features. The wrapper provides a modular, type-safe interface for common LinkedIn operations.

Features

  • Full TypeScript support with type definitions
  • Modular architecture with domain-based services
  • Easy account connection using li_at cookies
  • Streamlined search capabilities (URL-based and parameter-based)
  • Profile management (retrieve, edit, add experience)
  • Company information retrieval
  • Built-in pagination support
  • Centralized validation and error handling
  • Promise-based async/await interface

Prerequisites

  • Node.js 16+
  • An active Unipile account
  • Unipile API token
  • Access to a Unipile subdomain and port

Installation

npm install @entergreat/unipile-wrapper

Configuration

Initialize the wrapper with your Unipile credentials:

import { LinkedinService } from '@entergreat/unipile-wrapper';

// With default accountId (recommended for single-account usage)
const linkedin = new LinkedinService({
  unipileToken: 'your-unipile-token',
  subdomain: 'your-subdomain',
  port: 443,
  accountId: 'your-account-id'  // Optional: set default accountId
});

// Without default accountId (for multi-account usage)
const linkedin = new LinkedinService({
  unipileToken: 'your-unipile-token',
  subdomain: 'your-subdomain',
  port: 443
});

When accountId is set in config, you don't need to pass it to each method. You can still override it per-call:

// Uses default accountId from config
await linkedin.search.byParams({ params: { keywords: 'developer' } });

// Override with different accountId
await linkedin.search.byParams({
  accountId: 'different-account-id',
  params: { keywords: 'developer' }
});

Architecture

The wrapper is organized into domain-based services:

LinkedinService
├── account   → Account connection
├── search    → LinkedIn search operations
├── profile   → Profile management
└── company   → Company information

Usage

Connect LinkedIn Account

Add a LinkedIn account to Unipile using a li_at cookie:

const account = await linkedin.account.connect({
  loginCookie: 'your-li-at-cookie'
});

Search LinkedIn

Using Parameters

const results = await linkedin.search.byParams({
  accountId: 'your-unipile-account-id',
  params: {
    keywords: 'software engineer',
    location: 'United States'
  },
  cursor: '', // for pagination
  limit: 10
});

Using LinkedIn URL

const results = await linkedin.search.byUrl({
  accountId: 'your-unipile-account-id',
  searchUrl: 'https://www.linkedin.com/search/results/people/?keywords=developer',
  cursor: '',
  limit: 10
});

Retrieve Search Parameters

const suggestions = await linkedin.search.retrieveParameters({
  accountId: 'your-unipile-account-id',
  type: 'LOCATION',
  keywords: 'new york',
  limit: 5
});

Profile Management

Retrieve Profile

const profile = await linkedin.profile.retrieve({
  accountId: 'your-unipile-account-id',
  profileId: 'john-doe-123',
  linkedinSections: ['experience', 'education'],
  notify: false
});

Edit Profile

const result = await linkedin.profile.edit({
  accountId: 'your-unipile-account-id',
  profileData: {
    headline: 'Senior Software Engineer | Node.js Expert',
    summary: 'Passionate developer with 10+ years of experience...',
    location: { id: '105015875' }
  }
});

Add Experience

const result = await linkedin.profile.addExperience({
  accountId: 'your-unipile-account-id',
  experience: {
    role: 'Software Engineer',
    company: 'Acme Corp',
    company_id: '123456',
    description: 'Building awesome products',
    location: 'Tel Aviv, Israel',
    start_month: 3,
    start_year: 2024,
    skills: ['TypeScript', 'Node.js', 'React'],
    notify_network: false
  }
});

Company Information

// By company ID
const company = await linkedin.company.retrieve({
  accountId: 'your-unipile-account-id',
  companyId: '123456'
});

// By company URL
const company = await linkedin.company.retrieve({
  accountId: 'your-unipile-account-id',
  companyUrl: 'https://www.linkedin.com/company/acme-corp'
});

API Reference

LinkedinService

Constructor

new LinkedinService({
  unipileToken: string,   // Your Unipile API token
  subdomain: string,      // Your Unipile subdomain
  port: number | string,  // Unipile port number
  accountId?: string      // Optional: default account ID for all methods
})

AccountService (linkedin.account)

connect({ loginCookie })

Connects a LinkedIn account to Unipile using a li_at cookie.

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | loginCookie | string | Yes | LinkedIn li_at cookie value |

SearchService (linkedin.search)

byParams({ accountId, params, cursor, limit })

Performs a LinkedIn search using specified parameters.

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | accountId | string | No* | config.accountId | Unipile account ID | | params | object | No | {} | LinkedIn search parameters | | cursor | string | No | - | Pagination cursor | | limit | number | No | 10 | Results per page |

byUrl({ accountId, searchUrl, cursor, limit })

Performs a LinkedIn search using a LinkedIn search URL.

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | accountId | string | No* | config.accountId | Unipile account ID | | searchUrl | string | Yes | - | LinkedIn search URL | | cursor | string | No | - | Pagination cursor | | limit | number | No | 10 | Results per page |

retrieveParameters({ accountId, type, keywords, limit })

Retrieves LinkedIn search parameter suggestions.

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | accountId | string | No* | config.accountId | Unipile account ID | | type | string | Yes | - | Parameter type (e.g., LOCATION) | | keywords | string | No | "" | Search keywords | | limit | number | No | 3 | Number of suggestions |

*Required if not set in constructor config.

ProfileService (linkedin.profile)

retrieve({ accountId, profileId, linkedinSections, notify })

Retrieves a LinkedIn user profile.

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | accountId | string | No* | config.accountId | Unipile account ID | | profileId | string | Yes | - | LinkedIn profile ID or URL | | linkedinSections | string[] | No | [] | Sections to retrieve | | notify | boolean | No | false | Notify profile owner |

edit({ accountId, profileData })

Edits the LinkedIn profile of the account owner.

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | accountId | string | No* | config.accountId | Unipile account ID | | profileData | object | Yes | - | Profile fields to update |

ProfileData fields:

  • headline: string - Professional headline
  • summary: string - Profile bio/summary
  • location: { id: string } - Location object
  • picture: object - Profile/cover picture settings
  • experience: object - Experience data
  • education: object - Education entries

addExperience({ accountId, experience })

Adds a work experience position to the profile.

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | accountId | string | No* | config.accountId | Unipile account ID | | experience | ExperienceData | Yes | - | Experience details |

*Required if not set in constructor config.

ExperienceData fields:

| Field | Type | Required | Description | |-------|------|----------|-------------| | role | string | Yes | Job title | | company | string | Yes | Company name | | company_id | string | No | LinkedIn company ID | | description | string | No | Role description | | location | string | No | Job location | | start_month | number | No | Start month (1-12) | | start_year | number | No | Start year | | end_month | number | No | End month (1-12) | | end_year | number | No | End year | | skills | string[] | No | Associated skills | | notify_network | boolean | No | Notify connections |

CompanyService (linkedin.company)

retrieve({ accountId, companyId, companyUrl })

Retrieves LinkedIn company information.

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | accountId | string | No** | config.accountId | Unipile account ID | | companyId | string | No* | - | LinkedIn company ID | | companyUrl | string | No* | - | LinkedIn company URL |

*Either companyId or companyUrl must be provided.

**Required if not set in constructor config.

Error Handling

The wrapper throws ValidationError for invalid inputs:

import { ValidationError } from '@entergreat/unipile-wrapper';

try {
  await linkedin.profile.retrieve({ accountId: '', profileId: 'test' });
} catch (error) {
  if (error instanceof ValidationError) {
    console.error('Validation failed:', error.message);
  }
}

Dependencies

  • axios - HTTP client
  • form-data - Multipart form handling

Contributing

Contributions are welcome! Feel free to submit issues and pull requests.

License

MIT License - see LICENSE file for details