@westyx-nexus/sdk-vue package is hosted on the GitLab npm Package Registry. It is public - no token is required to install.
1. Configure npm to look at the registry
Add (or merge) the following to your project’s.npmrc:
Commit the
.npmrc to source control. It contains no credentials - every developer on the team automatically picks up the right registry.2. Install the package
Requirements
- Vue 3.3 or newer (Composition API - Options API is not supported)
- A modern browser environment with
fetchstreaming support -ReadableStreamresponse bodies (Chrome, Firefox, Safari, Edge - all evergreens) - TypeScript users: 5.0+ for full type compatibility (peer of Vue 3.3 typings)
Use a public API key
The SDK enforces this via:- A branded TypeScript type (
PublicApiKey) - gives you a compile-time hint when typing strictly - A runtime guard in the SDK constructor - throws a descriptive error before any network call
- A backend reject - a request carrying an
wxs_...key against a browser/public surface returns400 Bad Request
Importing
The package exposes both ESM and CJS builds:SSR / Nuxt
The fetch-based SSE stream is browser-only (the SDK skips it during SSR). In Nuxt 3, register the SDK in a client-only plugin:.client.ts suffix tells Nuxt to skip this plugin on the server, so SSR doesn’t try to open the stream.
Verifying connectivity
Before writing any code, confirm your endpoint and API key work with a plaincurl:
configs and flags (browser SDKs use public keys - secrets are never included). An HTTP 401 means the key is wrong; HTTP 404 means the slug is wrong.
Troubleshooting
Could not resolve '@westyx-nexus/sdk-vue'- your.npmrcis not picked up. Confirm it’s at the project root next topackage.json, and checknpm config get registry @westyx-nexus.401 Unauthorizedwhen runningnpm install- the registry might be configured with an old path. Switch to the numeric-ID variant above.Browser SDKs require a public keyat runtime - replace yourwxs_...key with awxp_...key from the same service in the Westyx Nexus admin UI.
