@byokit/accounts has 2,923 recorded weekly downloads on npm.
About @byokit/accounts
Install
npm install @byokit/accounts
· Latest release · All releases
Quickstart
npm install @byokit/accounts
The whole ChatGPT flow, run against the stand-in OpenAI so it needs no account and no network beyond loopback: sign in by device code, see the status, ask.
import { Accounts, memoryStore, portable } from '@byokit/accounts';
import { mockOpenAI } from '@byokit/accounts/testing';
const openai = await mockOpenAI(); // a stand-in OpenAI on 127.0.0.1, no account needed
const accounts = new Accounts(
{ authBase: openai.base, apiBase: openai.base, store: () => memoryStore() }, // in memory: this demo ends with it
portable, // device code with fetch alone, as on a phone or in a browser
);
const shown = await accounts.login(1, 'chatgpt');
console.log(shown?.state, shown?.via, shown?.code);
openai.approve(shown!.code!); // the person types the code on the provider's page
await accounts.finished(1, 'chatgpt'); // the whole sign-in, once the code is approved
console.log((await accounts.status(1, 'chatgpt')).words);
const answer = await accounts.respond(1, { model: 'gpt-6-sol', instructions: 'Answer briefly.', input: 'Plan my day', onText: (d) => process.stdout.write(d) });
console.log('\nfinal:', answer);
await openai.close();
waiting code MOCK-10001
ChatGPT is connected.
You said: Plan my day
final: You said: Plan my day
The stand-in echoes the question. In an app, drop authBase, apiBase and portable, and give each person a store,
as below.
On a computer
On a computer it uses Pi's @earendil-works/pi-ai sign-in
flows, pinned exactly:
import { isolate, launchEnv } from '@byokit/accounts/isolate';
const dir = isolate('/path/to/app/engine'); // creates the folder; never changes process.env
const launch = launchEnv({ set: { PI_CODING_AGENT_DIR: dir, PI_OFFLINE: '1',
PI_TELEMETRY: '0', PI_SKIP_VERSION_CHECK: '1' } });
// Pass launch.env to spawn(), or launch to Herdr's startAgent({ env: launch, ... }).
// Every BYOKit app on this computer keeps sign-ins at one machine store under one seal, so the person signs in once.
export async function connect() {
const { Accounts, machineStore } = await import('@byokit/accounts');
const { osKeyringSeal } = await import('@byokit/secrets');
const seal = osKeyringSeal({ service: 'byokit' });
const accounts = new Accounts({ store: (member) => machineStore(member, seal) });
const shown = await accounts.login(1, 'chatgpt', { via: 'code' }); // { state: 'waiting', code, url }
// show shown.code and shown.url; the sign-in finishes by itself
return { shown, status: await accounts.status(1, 'chatgpt') };
}
On a phone or in a browser…
Description from the npm listing.
- typescript
- ai
- ai-sdk
- react-native
- web
- privacy
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (1)Similar npm AI SDKs plugins
All 20 @byokit/accounts alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@byokit/accounts. First seen Oct 26, 2026; last successful collection Oct 26, 2026. See the methodology.