Getting started

Quickstart

Create a project, publish a config and read it from your app.

This walkthrough takes you from an empty account to a config that your app reads from the CDN.

1. Create a project

Sign in, open All projects and choose New project. A project has a name and an alias. The alias is a short identifier that is safe to use in URLs.

2. Add a consumer

A consumer is a client that receives configs, for example game-client or backend. Open Project settings → Consumers and add one. A file reaches a consumer only when the file is assigned to it.

3. Create a file

Open File editor and create a file, for example settings.json. Write some content and save. Then assign the file to your consumer in Project settings → Consumers.

settings.json
{
  "maxPlayers": 8,
  "welcomeMessage": "Hello!"
}

4. Publish

Open Versions, choose the default version and publish it. A live log shows the progress. When it finishes, the CDN holds a release of that version.

A version that was never published gives clients nothing. The Integration page warns you about this.

5. Read it from your app

Open Integration. It shows the CDN URL of your project and ready-to-copy code for your version and consumer.

import { Veresk, VereskEventName } from '@veresk-tool/nodejs';

const veresk = new Veresk({
  cdnUrls: ['<CDN URL>'],
  version: 'default',
  consumer: 'backend',
});
veresk.on(VereskEventName.Error, (error) => console.error(error));
await veresk.init();

const settings = veresk.getContent<{ maxPlayers: number }>('settings.json');

Next steps