oneclient
v0.1.8
Published
One package for the complete OneClient TypeScript SDK and developer CLI.
Maintainers
Readme
oneclient
One package for the complete OneClient TypeScript SDK and developer CLI.
npm install oneclient
npx oneclient login --email [email protected]
npx oneclient init --project-name "My app"The hosted CLI already knows the production control API. Set ONECLIENT_API_URL only when a command
targets a project environment or a self-hosted/local control plane.
Browser application
oneclient init shows the development API URL, environment ID, and initial pk_*/sk_* values
once. A publishable key is safe to embed in browser code; server and deploy keys are not.
import { createClient } from "oneclient";
const one = createClient({
baseUrl: import.meta.env.VITE_ONECLIENT_API_URL,
publishableKey: import.meta.env.VITE_ONECLIENT_PUBLISHABLE_KEY,
});
await one.auth.sendOtp({ email: "[email protected]" });Schema, policy, and local auth origin
export ONECLIENT_API_URL=https://dev_REFERENCE.api.one-client.com
export ONECLIENT_SERVER_KEY=sk_REDACTED
npx oneclient sql --file migrations/001_create_feedback.sql
npx oneclient policy:publish --table feedback --file oneclient.policy.json
npx oneclient auth-origin:add --environment env_DEVELOPMENT --origin http://localhost:5173Each SQL file contains one statement so its read, write, and retained-storage bounds are explicit.
Development deployment
npm run build
npx oneclient artifact:create \
--directory . \
--manifest .oneclient/manifest.json \
--archive .oneclient/app.tar \
--framework vite \
--build-command "npm run build" \
--output-directory dist \
--lockfile npm
npx oneclient deploy-token:create --environment env_DEVELOPMENT --name local-cli
export ONECLIENT_DEPLOY_TOKEN=dp_VALUE_SHOWN_ONCE
npx oneclient deploy \
--manifest .oneclient/manifest.json \
--archive .oneclient/app.tar \
--project prj_PROJECT \
--environment env_DEVELOPMENT \
--wait
# The deploy token is an environment key; revoke it by the id returned at creation.
npx oneclient key:revoke --environment env_DEVELOPMENT --key key_DEPLOY_TOKENInteractive terminals receive a compact interface. Pipes and CI receive stable JSON automatically;
--json makes that behavior explicit. Developer sessions are stored in an owner-only local file.
sk_* and dp_* values stay in environment variables and are never persisted by the CLI.
Full quickstart: one-client.com/docs/quickstart · Agent context: one-client.com/llms.txt
