Quickstart
Create an app, issue a test API key, and validate your first request.
This quickstart connects your business backend with the server SDK. For Web, macOS or Windows login through the system browser, follow the OAuth / OIDC guide. Native applications use a public client with PKCE and keep service credentials on the backend.
1. Create an app in Studio
Sign in to Studio, go to Applications, and create an app. Open the app and wait for its test environment to become ready.
2. Issue a test API key
In the test environment, select Manage API keys. Create a key with the sessions:validate scope for this quickstart. Copy the key when it is displayed, then save it in your backend's secret store.
Set these variables in your backend process:
| Variable | Value |
|---|---|
VAUTH_APPLICATION_ID | App ID shown in Studio |
VAUTH_ENVIRONMENT | test |
VAUTH_SERVICE_CREDENTIAL | Your test API key |
Keep the key out of browser bundles, mobile apps, logs, and public variables such as NEXT_PUBLIC_* and VITE_*.
3. Validate a sample session
Install the server SDK from npm in your backend project. See the SDK guide for method permissions and package details.
npm install @virtneu/authimport { VAuthClient } from '@virtneu/auth';
const auth = new VAuthClient({
baseUrl: 'https://auth-api.virtneu.com',
applicationId: process.env.VAUTH_APPLICATION_ID!,
environment: 'test',
serviceCredential: process.env.VAUTH_SERVICE_CREDENTIAL!,
});
const { data, request_id } = await auth.validateSession(
'integration-check-unknown-session',
);
console.log({ active: data.active, request_id });Expect active: false. The sample token is intentionally invalid, so this checks that your backend can reach Virtneu Auth and that the App, environment, key, and scope are accepted.
Next, configure registration and login. You can also make the same request over HTTP.