@asiyst/sdk
Client-side runtime that connects a website to Asiyst Cloud.
This package does not contain model keys, database credentials, or other server secrets. Identify the project with projectId and publicKey only. Those values are public project credentials, not secrets.
Install
npm install @asiyst/sdk
Then connect the project:
npx @asiyst/cli init
asiyst init opens https://asiyst.com so you can create a project and copy credentials. Avatar appearance and behavior live in Asiyst Cloud so you can change them without redeploying the site.
Usage
Project ID is required. The value must be the public Project ID for the target Asiyst project, not the developer account user ID and not the internal Supabase UUID.
import { Asiyst } from "@asiyst/sdk";
await Asiyst.init({
projectId: "<PUBLIC_PROJECT_ID>",
publicKey: "<PUBLIC_KEY>",
avatarId: "<PUBLIC_AVATAR_ID>",
});
Asiyst.open();
Do not pass a secret API key as publicKey or omit projectId.
avatarId is a public identifier, not an authorization credential. The server remains authoritative for project and installation authorization.
Knowledge sources, including optional GitHub repositories, are configured in Asiyst Web. The SDK does not receive GitHub credentials and does not copy Knowledge Base content into the website. It initializes the verified project/avatar and retrieves authorized knowledge through the Asiyst backend.
await Asiyst.init({
publicKey: "<PUBLIC_KEY>",
});
// throws: Asiyst SDK: projectId is required.
Mark important controls so the assistant can find them across layouts:
<button data-asiyst="pricing">Pricing</button>
<button
data-asiyst="checkout"
data-asiyst-description="Proceed to checkout"
>
Checkout
</button>
The production API base is https://nqhxpgsjofzqudyqkqib.supabase.co/functions/v1/api. It is used by default and can only be overridden explicitly through apiBaseUrl for a controlled non-production deployment.
If runtime config is unavailable, the SDK retains its local or eligible cached fallback config. getConnectionStatus() reports runtime verification separately. Visitor chat requires a verified installation and runtime token. Cloud task planning, workflows, telemetry, and website-map upload are not part of the current approved contract and are not sent.
Documentation
- Architecture:
docs/ARCHITECTURE.md - API and events:
docs/API.md - Security:
docs/SECURITY.md - Runtime contract:
docs/sdk-cli-contract.md - Runtime details:
docs/sdk-runtime.md - Installation:
docs/sdk-installation.md - Troubleshooting:
docs/TROUBLESHOOTING.md