Skip to content

SDKs ​

PackageRuns onWhat it does
foidYour server: Python ≥ 3.10Continue with FOID code exchange (client secret or key pair), the Open API, webhook verification, PKCE helpers, python -m foid keygen
@foid/nodeYour server: Node ≥ 18, no dependenciesThe same as Python, for Node. npx foid keygen
@foid/reactThe browser<FoidProvider>, the <ContinueWithFoid> button, useFoidLogin(), plus a framework-free core (@foid/react/core)

The server SDKs hold your secrets. The React SDK only ever has your public client ID. A typical setup uses one of each: the button in your front end, and the server SDK in the endpoint that receives the code.

Install ​

Not on PyPI / npm yet

The SDKs are not published to the public registries yet. Install them from the FOID repository, or from packed files.

From the repository (with the FOID repo checked out next to your project):

bash
pip install "./sdks/python[keypair]"       # or, in a uv project: uv add ./sdks/python --extra keypair
bash
npm install ./sdks/node
bash
npm install ./sdks/react

The keypair extra pulls in cryptography, which is only needed for key pairs (private_key_jwt) and keygen. Client-secret apps and the Open API need only httpx.

From packed files. This is how the Harbor example app does it, as if the SDK came from a registry:

bash
# from the FOID repo; OUT is a vendor/ folder in your project
OUT=/path/to/your-project/vendor
(cd sdks/python && uv build --wheel -o "$OUT")          # foid-0.1.0-py3-none-any.whl
(cd sdks/node   && npm pack --pack-destination "$OUT")  # foid-node-0.1.0.tgz
(cd sdks/react  && npm pack --pack-destination "$OUT")  # foid-react-0.1.0.tgz

Then depend on the file: "@foid/node": "file:vendor/foid-node-0.1.0.tgz" in package.json, or foid = { path = "vendor/foid-0.1.0-py3-none-any.whl" } under [tool.uv.sources].

Configuration ​

The server SDKs default to the hosted API at https://api.foid.ng. When you run FOID yourself, pass the base URL:

python
from foid import Foid
foid = Foid(api_key="FOID_TEST_…", base_url="http://localhost:8000")
js
import { Foid } from '@foid/node'
const foid = new Foid({ apiKey: 'FOID_TEST_…', baseUrl: 'http://localhost:8000' })

The React SDK defaults to https://app.foid.ng for the popup. Pass foidUrl="http://localhost:5173" to <FoidProvider> locally.

Which credential goes where ​

CredentialPythonNodeReact
API key (FOID_TEST_…)api_key=apiKeynever
Client ID (foid_app_…)client_id=clientId<FoidProvider clientId>
Client secret (foid_cs_…)client_secret=clientSecretnever
Private key PEMprivate_key_pem=privateKeyPemnever
Webhook secret (whsec_…)verify_webhook(…, secret)verifyWebhook(…, secret)never

One client object can hold several credentials. It uses the API key for the Open API, and the client secret or private key for oauth.exchange. See Keys and credentials.

See it working ​

  • Playground: the real button, in your browser.
  • Harbor example app: a complete app with a React front end and a Python or Node back end, exercising every SDK feature.

FOID — Fintech Open Identity. Test mode never touches real identity data.