Skip to main content

SDKs

TypeScript (official)​

@wefunder/sdk is the official TypeScript SDK. It covers every public endpoint, handles token refresh and cursor pagination, and ships with types generated from the OpenAPI spec. Source and issues live at Wefunder/wefunder-node.

npm install @wefunder/sdk

Node 20 or newer. ESM and CommonJS are both supported. The SDK follows semantic versioning from 1.0.0: breaking changes only in a new major version; pin a version.

Public catalog with a publishable key​

For public reads you can skip the token exchange and hand the SDK your publishable key (pk_live_…) as the bearer; see Authentication.

import { Wefunder } from "@wefunder/sdk";

const wf = new Wefunder({ accessToken: process.env.WEFUNDER_PUBLISHABLE_KEY! });
const { data } = await wf.unwrap(wf.raw.getCompany({ path: { id: "co_8Kd0aB3xQ9k2vF8mNp1zT5wY" } }));
console.log(data?.attributes?.current_raise?.amount_raised_cents);

Public catalog with a server key​

import { Wefunder } from "@wefunder/sdk";

const wf = await Wefunder.fromClientCredentials({
clientId: process.env.WEFUNDER_CLIENT_ID!,
clientSecret: process.env.WEFUNDER_CLIENT_SECRET!,
scopes: ["read:public"],
});

const page = await wf.offerings.list({ sort: "most_raised" });
for (const offering of page.data ?? []) {
console.log(offering.id, offering.attributes?.company_name);
}

On behalf of a user​

The SDK includes helpers for the Authorization Code flow with PKCE: generatePkce, createAuthorizationUrl, and exchangeCode. Once you hold the user's tokens:

const me = await wf.users.me();

// Auto-paginate lazily:
for await (const investment of wf.investments.all()) {
console.log(investment.id);
}

Where an SDK example exists, the API Reference shows it next to the endpoint's HTTP request.

Python (official)​

wefunder is the official Python SDK: sync and asyncio clients on httpx, OAuth helpers (generate_pkce, create_authorization_url, exchange_code, refresh rotation through a TokenStore), lazy cursor pagination, typed errors, webhook verification (construct_event), and a generated typed layer for every public operation reachable through wf.call. Source and issues live at Wefunder/wefunder-python.

pip install wefunder

Python 3.11 or newer. The SDK follows semantic versioning from 1.0.0; pin a version.

from wefunder import Wefunder

wf = Wefunder(access_token=COMPANY_TOKEN) # a company-owned token from an installation
page = wf.investments.list(per_page=100) # bootstrap; pass cursor=… or updated_since=… to sync
for record in page.data:
print(record.id, record.group, record.amounts.committed_cents)
checkpoint = page.meta.next_cursor # persist after every page

Ruby (official)​

wefunder is the official Ruby SDK: a Wefunder::Client on Faraday with a generated typed layer for every public operation, OAuth helpers (Wefunder.generate_pkce, Wefunder.create_authorization_url, Wefunder.exchange_code, refresh rotation through a store object), lazy cursor pagination (all, collect), typed errors, and webhook verification (Wefunder.construct_event, Wefunder.dispatch_webhook). Source and issues live at Wefunder/wefunder-ruby.

gem install wefunder
# or in a Gemfile:
gem "wefunder", "~> 1.0"

Ruby 3.2 or newer. The SDK follows semantic versioning from 1.0.0; pin a version.

require "wefunder"

wf = Wefunder::Client.new(access_token: COMPANY_TOKEN) # a company-owned token from an installation
page = wf.investments.list(per_page: 100) # bootstrap; pass cursor: or updated_since: to sync
page.data.each { |record| puts [record.id, record.group, record.amounts.committed_cents].join(" ") }
checkpoint = page.meta.next_cursor # persist after every page

Example applications​

wefunder-examples holds complete, runnable applications built on these SDKs, one directory each, with tests that run against the published SDK on every push and weekly. The snippets on this site and in the API reference come from the SDK repositories' examples/ directories; the examples repository is for whole apps.

ExampleShowsStack
investment-sync-nextjsInstall on the companies you serve, mirror their investments with cursor sync, stay current with signed webhooks, post a money feedNext.js, TypeScript, @wefunder/sdk

Copy one directory rather than the repository: npx degit Wefunder/wefunder-examples/<dir> my-app.

Community libraries​

None yet. If you publish one, tell us and we will list it here.

OpenAPI spec​

The API Reference is generated from our OpenAPI 3.0 spec, filtered to the public tiers. Preview endpoints are not in it. A downloadable copy of the public spec is on the way; ask support if you need it for code generation today.

Was this page helpful?