Getting started
This guide walks through wiring the Eventista SDKs into a fresh consumer app — web, Node, or React Native.
1. Authenticate to the registry
Section titled “1. Authenticate to the registry”The packages live in a private AWS CodeArtifact repository. Each developer machine and CI environment must obtain a token before bun install can resolve @eventista/*.
aws codeartifact login --tool npm \ --domain eventista-sdks --domain-owner 533267118170 \ --repository eventista-sdks --region ap-southeast-1The token is valid for 12 hours. Re-run the command when installs start failing with 401.
2. Install the packages
Section titled “2. Install the packages”Pick the packages you need. @eventista/sdk-core is a transitive dependency of every other SDK — you only need to install it explicitly if you use it directly.
bun add @eventista/sdk-auth @eventista/sdk-api-client @eventista/sdk-corebun add @eventista/sdk-api-client @eventista/sdk-corebun add @eventista/sdk-core3. Wire up a client
Section titled “3. Wire up a client”-
Pick an environment.
AuthClientships withAuthEnvironment.ProductionandAuthEnvironment.Development— these resolve the right backend URLs for you. -
Provide a storage adapter. Tokens are persisted via a
TokenStorageAdapteryou supply. The default in-memory adapter is fine for SSR and tests, but every interactive app should wire its own. -
Subscribe to token changes.
onTokensChangedfires whenever the SDK persists a new pair, including on first login and refresh. Use this to mirror state into your auth store.
import { AuthClient, AuthEnvironment } from "@eventista/sdk-auth";
export const auth = new AuthClient({ environment: AuthEnvironment.Production, onTokensChanged: (tokens) => { if (tokens === null) { // signed out return; } // tokens.accessToken, tokens.refreshToken, tokens.expiresAt },});4. Make your first request
Section titled “4. Make your first request”const result = await auth.login({ email: "a@b.test", password: "secret" });
if (result.isErr) { if (result.code === "AUTH_INVALID_CREDENTIALS") { showError("Wrong email or password"); return; } reportToSentry(result.code, result.errorCode, result.err); return;}
setUser(result.data.user);AuthClient methods never throw on auth failure — branch on result.isErr first, then on the typed result.code.
Next steps
Section titled “Next steps”- @eventista/sdk-core — HTTP primitives, error class, signing helpers.
- @eventista/sdk-api-client — REST client with signing and storage adapters.
- @eventista/sdk-auth — full auth flow including refresh, password reset, and Google OAuth.
- API reference — auto-generated TypeDoc for every public export.