Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@polar-sh/sdk
Advanced tools
The Polar SDK is a JavaScript library with capabilities to interact with the Polar API.
The Polar SDK is a JavaScript library with capabilities to interact with the Polar API.
The SDK is compatible with both browser & server-side runtimes. The API client is automatically generated from our OpenAPI implementation, making it up-to-date with the server-side API at any time.
Read more about our OpenAPI Schema & documentation
The SDK is available from NPM.
npm install @polar-sh/sdk
Once installed, you may import the SDK like you usually would:
import { Configuration, PolarAPI } from '@polar-sh/sdk'
const api = new PolarAPI()
const authedApi = new PolarAPI(
new Configuration({
accessToken: '<MY_ACCESS_TOKEN>',
}),
)
You can acquire an access token through your Settings page. This can be used to authenticate yourself with the API for create/update/delete actions.
You can easily retrieve issues looking for funding using the Funding-service.
import {
Configuration,
ListFundingSortBy,
Platforms,
PolarAPI,
} from '@polar-sh/sdk'
const api = new PolarAPI(new Configuration())
const issuesFunding = await api.funding.search({
platform: Platforms.GITHUB,
organizationName: '<MY_GITHUB_ORGANIZATION_NAME>',
badged: true,
closed: false,
sorting: [
ListFundingSortBy.MOST_FUNDED,
ListFundingSortBy.MOST_ENGAGEMENT,
ListFundingSortBy.NEWEST,
],
limit: 20,
})
Retrieve Polar data about a given GitHub issue.
import { Configuration, PolarAPI } from '@polar-sh/sdk'
const api = new PolarAPI(new Configuration())
const params = {
organization: 'polarsource',
repo: 'polar',
number: 900,
}
const issue = await api.issues.lookup({
externalUrl: `https://github.com/${params.organization}/${params.repo}/issues/${params.number}`,
})
Adds a Polar badge to a given GitHub issue.
import { Configuration, PolarAPI } from '@polar-sh/sdk'
const api = new PolarAPI(
new Configuration({
accessToken: '<MY_ACCESS_TOKEN>',
}),
)
await api.issues.addPolarBadge({
id: '<ISSUE_ID>',
})
FAQs
Developer-friendly & type-safe Typescript SDK specifically catered to leverage [Polar](https://polar.sh) API.
The npm package @polar-sh/sdk receives a total of 1,439 weekly downloads. As such, @polar-sh/sdk popularity was classified as popular.
We found that @polar-sh/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.