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

codeforge-main-affinity-sdk

v0.3.9

Published

> **Unofficial SDK** — generated from @codeforge-main/affinity-sdk's public OpenAPI specification by the [CodeForge platform](https://www.code-forge.net). Not affiliated with or endorsed by @codeforge-main/affinity-sdk.

Readme

Unofficial SDK — generated from @codeforge-main/affinity-sdk's public OpenAPI specification by the CodeForge platform. Not affiliated with or endorsed by @codeforge-main/affinity-sdk.


codeforge-main-affinity-sdk

Version 0.3.9

Full generator behavior documentation: https://www.code-forge.net/docs

Requires Node 20+ (or a modern browser) — the generated transport uses AbortSignal.any and AbortSignal.timeout.

Install

npm install codeforge-main-affinity-sdk
yarn add codeforge-main-affinity-sdk
pnpm add codeforge-main-affinity-sdk

Usage

This SDK is exposed as a single, fully typed client class. Construct it once with your shared configuration and call any API operation as a method — each returns the deserialized response alongside HTTP metadata.

import { AffinityApiV2Client } from 'codeforge-main-affinity-sdk'

const client = new AffinityApiV2Client({
	baseUrl: 'https://api.affinity.co',
	auth: { type: 'bearer', token: 'YOUR_API_TOKEN' },
})

const response = await client.v2_authWhoamiGet()

console.log(response.status) // HTTP status code
console.log(response.data)   // typed as V2AuthWhoamiGetResponse

The client holds the shared configuration (baseUrl, auth, retry, hooks). Each method accepts a per-call context extending HttpClientContext — supply the operation-specific payload / parameters, and override any shared field per call.

Available operations

  • v2_authWhoamiGet
  • v2_callsGet
  • v2_chatMessagesGet
  • v2_companiesGet
  • v2_companiesFieldsGet
  • v2_companiesFieldsFieldIdDropdownOptionsGet
  • v2_companiesSearchPost
  • v2_companiesCompanyIdGet
  • v2_companiesCompanyIdFieldsGet
  • v2_companiesCompanyIdFieldsPatch
  • v2_companiesCompanyIdFieldsFieldIdGet
  • v2_companiesCompanyIdFieldsFieldIdPost
  • v2_companiesCompanyIdFieldsFieldIdValuesGet
  • v2_companiesCompanyIdListEntriesGet
  • v2_companiesCompanyIdListsGet
  • v2_companiesCompanyIdNotesGet
  • v2_companiesCompanyIdRelationshipsGet
  • v2_companyMergesGet
  • v2_companyMergesPost
  • v2_companyMergesMergeIdGet
  • v2_duplicatesCompanySuggestionsGet
  • v2_duplicatesPersonSuggestionsGet
  • v2_emailsGet
  • v2_feedbackPost
  • v2_fieldValueChangesGet
  • v2_filesSearchPost
  • v2_inferredConnectionsCoworkersGet
  • v2_inferredConnectionsInvestorExecutiveConnectionsGet
  • v2_listsGet
  • v2_listsPost
  • v2_listsListIdGet
  • v2_listsListIdFieldsGet
  • v2_listsListIdFieldsFieldIdDropdownOptionsGet
  • v2_listsListIdFieldsFieldIdDropdownOptionsPost
  • v2_listsListIdFieldsFieldIdDropdownOptionsDropdownOptionIdGet
  • v2_listsListIdFieldsFieldIdDropdownOptionsDropdownOptionIdPost
  • v2_listsListIdFieldsFieldIdDropdownOptionsDropdownOptionIdDelete
  • v2_listsListIdListEntriesGet
  • v2_listsListIdListEntriesPost
  • v2_listsListIdListEntriesSearchPost
  • v2_listsListIdListEntriesListEntryIdGet
  • v2_listsListIdListEntriesListEntryIdFieldValueChangesGet
  • v2_listsListIdListEntriesListEntryIdFieldsGet
  • v2_listsListIdListEntriesListEntryIdFieldsPatch
  • v2_listsListIdListEntriesListEntryIdFieldsFieldIdGet
  • v2_listsListIdListEntriesListEntryIdFieldsFieldIdPost
  • v2_listsListIdListEntriesListEntryIdFieldsFieldIdValuesGet
  • v2_listsListIdSavedViewsGet
  • v2_listsListIdSavedViewsViewIdGet
  • v2_listsListIdSavedViewsViewIdListEntriesGet
  • v2_meetingsGet
  • v2_meetingsMeetingIdGet
  • v2_notesGet
  • v2_notesPost
  • v2_notesSearchPost
  • v2_notesNoteIdGet
  • v2_notesNoteIdPost
  • v2_notesNoteIdDelete
  • v2_notesNoteIdAttachedCompaniesGet
  • v2_notesNoteIdAttachedOpportunitiesGet
  • v2_notesNoteIdAttachedPersonsGet
  • v2_notesNoteIdRepliesGet
  • v2_opportunitiesGet
  • v2_opportunitiesOpportunityIdGet
  • v2_opportunitiesOpportunityIdPost
  • v2_opportunitiesOpportunityIdDelete
  • v2_opportunitiesOpportunityIdNotesGet
  • v2_personMergesGet
  • v2_personMergesPost
  • v2_personMergesMergeIdGet
  • v2_personsGet
  • v2_personsPost
  • v2_personsFieldsGet
  • v2_personsFieldsFieldIdDropdownOptionsGet
  • v2_personsSearchPost
  • v2_personsPersonIdGet
  • v2_personsPersonIdDelete
  • v2_personsPersonIdFieldsGet
  • v2_personsPersonIdFieldsPatch
  • v2_personsPersonIdFieldsFieldIdGet
  • v2_personsPersonIdFieldsFieldIdPost
  • v2_personsPersonIdFieldsFieldIdValuesGet
  • v2_personsPersonIdListEntriesGet
  • v2_personsPersonIdListsGet
  • v2_personsPersonIdNotesGet
  • v2_personsPersonIdRelationshipsGet
  • v2_rateLimitGet
  • v2_remindersGet
  • v2_remindersPost
  • v2_remindersReminderIdGet
  • v2_remindersReminderIdPost
  • v2_remindersReminderIdDelete
  • v2_semanticSearchPost
  • v2_tasksCompanyMergesGet
  • v2_tasksCompanyMergesTaskIdGet
  • v2_tasksPersonMergesGet
  • v2_tasksPersonMergesTaskIdGet
  • v2_teamsGet
  • v2_teamsTeamIdGet
  • v2_transcriptsGet
  • v2_transcriptsTranscriptIdGet
  • v2_transcriptsTranscriptIdFragmentsGet
  • v2_usersGet
  • v2_usersUserIdGet
  • v2_webhooksGet
  • v2_webhooksPost
  • v2_webhooksWebhookIdGet
  • v2_webhooksWebhookIdPost
  • v2_webhooksWebhookIdDelete

Transport

Every request goes through the same transport: a per-attempt timeout, cancellation via AbortSignal, and an optional custom fetch.

const client = new AffinityApiV2Client({
	timeoutMs: 10_000, // default 60000ms, applied fresh to each retry attempt
})

const controller = new AbortController()
setTimeout(() => controller.abort(), 5_000)

await client.v2_authWhoamiGet({ signal: controller.signal })

timeoutMs is per attempt, not per call — a request that times out and then retries gets a fresh timer on each attempt, and throws TimeoutError if every attempt times out. A caller-triggered AbortSignal is never retried; a timeout is, under the same rule as a network error. Streaming operations ignore timeoutMs and support only caller cancellation.

Custom fetch

Pass a fetch implementation to route every request through it — a proxy included, via undici's ProxyAgent:

import { ProxyAgent, fetch as undiciFetch } from 'undici'

const dispatcher = new ProxyAgent('http://localhost:8080')
const client = new AffinityApiV2Client({
	fetch: (url, init) => undiciFetch(url, { ...init, dispatcher }),
})

hooks.makeRequest wins when both are set — it replaces the whole transport, and fetch is read only by the built-in one.

Raw requests

An endpoint the generated operations don’t model is still reachable, through the same auth, retries, timeout and hooks:

const { data, response } = await client.get('/v1/status')
await client.post('/v1/events', { body: { type: 'ping' } })

// the general form, for a method the verb helpers don’t cover:
await client.request({ method: 'OPTIONS', path: '/v1/status' })

path is joined onto baseUrl with the URL constructor — a leading / resolves from the origin (dropping any path segment baseUrl itself carries); a relative segment appends after it. A plain-object body is JSON-serialized with a JSON Content-Type; pass an already-encoded value (a string, FormData, ...) to send anything else. data parses by the response’s own Content-Type: JSON via .json(), a textual type via .text(), anything else as a Blob.

Errors

A non-OK response throws one of these HttpError subclasses, picked by an exact status match first, then any >= 500 response as InternalServerError, then plain HttpError for anything else. Every one of them is also an instanceof HttpError, so a catch-all keeps working alongside a narrower check.

| Class | Status | | --- | --- | | BadRequestError | 400 | | AuthenticationError | 401 | | PermissionDeniedError | 403 | | NotFoundError | 404 | | ConflictError | 409 | | UnprocessableEntityError | 422 | | RateLimitError | 429 | | InternalServerError | any >= 500 |

import { HttpError, NotFoundError } from 'codeforge-main-affinity-sdk'

try {
	await client.v2_authWhoamiGet()
} catch (error) {
	if (error instanceof NotFoundError) {
		// error.status is narrowed to 404
	} else if (error instanceof HttpError) {
		// any other non-OK response — error.status is number
	}
	throw error
}

Validation

Every model is plain data — the shape it has on the wire. This SDK carries no schemas and no runtime dependency, so nothing is validated for you: response.data is the parsed body typed as the operation declares it.

Regenerate the SDK with validation schemas turned on to get a zod schema exported beside every model type.

Generated by CodeForge v0.86.9.