<!-- Generated by vovk-cli v0.0.1 at 2026-03-16T17:12:26.407Z -->
<p align="center">
  <a href="https://vovk.dev">
    <picture>
      <source width="300" media="(prefers-color-scheme: dark)" srcset="https://vovk.dev/vovk-logo-white.svg">
      <source width="300" media="(prefers-color-scheme: light)" srcset="https://vovk.dev/vovk-logo.svg">
      <img width="300" alt="vovk" src="https://vovk.dev/vovk-logo.svg">
    </picture>
  </a>
  <br>
  <strong>Back-end Framework for Next.js App Router</strong>
  <br />
  <a href="https://vovk.dev/">Documentation</a>
  &nbsp;&nbsp;
  <a href="https://vovk.dev/quick-install">Quick Start</a>
  &nbsp;&nbsp;
  <a href="https://vovk.dev/performance">Performance</a>
</p>

# vovk-examples v3.0.22 [![TypeScript](https://badgen.net/badge/-/TypeScript?icon=typescript&label&labelColor=blue&color=555555)](https://www.typescriptlang.org/) [![Vovk.ts](https://badgen.net/badge/Built%20with/Vovk.ts/333333?icon=https://vovk.dev/icon-white.svg)](https://vovk.dev)

> Vovk examples

License: **MIT**

```bash
# Install the package
npm install vovk-examples
```

## UserZodRPC

### UserZodRPC.updateUser

> Update user (Zod)

Update user by ID with Zod validation

`POST https://examples.vovk.dev/api/users-zod/{id}`

```ts
import { UserZodRPC } from 'vovk-examples';

const response = await UserZodRPC.updateUser({
  body: {
    // -----
    // User object
    // -----
    // User full name
    name: 'John Doe',
    // User age
    age: 30,
    // User email
    email: 'john.doe@example.com',
  },
  query: {
    // Notification type
    notify: 'email',
  },
  params: {
    // User ID
    id: '00000000-0000-0000-0000-000000000000',
  },
});

console.log(response);
/* 
{
    // -----
    // Response object
    // -----
    // Success status
    success: true
}
*/
```

## UserZodWithServiceRPC

### UserZodWithServiceRPC.updateUser

> Update user (Zod with service)

Update user by ID with Zod validation

`POST https://examples.vovk.dev/api/users-zod-with-service/{id}`

```ts
import { UserZodWithServiceRPC } from 'vovk-examples';

const response = await UserZodWithServiceRPC.updateUser({
  body: {
    // -----
    // User object
    // -----
    // User full name
    name: 'John Doe',
    // User age
    age: 30,
    // User email
    email: 'john.doe@example.com',
  },
  query: {
    // Notification type
    notify: 'email',
  },
  params: {
    // User ID
    id: '00000000-0000-0000-0000-000000000000',
  },
});

console.log(response);
/* 
{
    // -----
    // Response object
    // -----
    // Success status
    success: true,
    // User ID
    id: "00000000-0000-0000-0000-000000000000"
}
*/
```

## UserArktypeRPC

### UserArktypeRPC.updateUser

> Update user (Arktype)

Update user by ID with Arktype validation

`POST https://examples.vovk.dev/api/users-arktype/{id}`

```ts
import { UserArktypeRPC } from 'vovk-examples';

const response = await UserArktypeRPC.updateUser({
  body: {
    // -----
    // User object
    // -----
    // User age
    age: 0,
    // User email
    email: 'user@example.com',
    // User full name
    name: 'string',
  },
  query: {
    // Notification type
    notify: 'email',
  },
  params: {
    // User ID
    id: '00000000-0000-0000-0000-000000000000',
  },
});

console.log(response);
/* 
{
    // Success status
    success: true
}
*/
```

## UserValibotRPC

### UserValibotRPC.updateUser

> Update user (Valibot)

Update user by ID with Valibot validation

`POST https://examples.vovk.dev/api/users-valibot/{id}`

```ts
import { UserValibotRPC } from 'vovk-examples';

const response = await UserValibotRPC.updateUser({
  body: {
    // -----
    // User object
    // -----
    // User full name
    name: 'string',
    // User age
    age: 0,
    // User email
    email: 'user@example.com',
  },
  query: {
    // Notification type
    notify: 'email',
  },
  params: {
    // User ID
    id: '00000000-0000-0000-0000-000000000000',
  },
});

console.log(response);
/* 
{
    // -----
    // Response object
    // -----
    // Success status
    success: true
}
*/
```

## BasicRPC

### BasicRPC.getHello

> Get a greeting

Get a greeting from the server

`GET https://examples.vovk.dev/api/basic/greeting`

```ts
import { BasicRPC } from 'vovk-examples';

const response = await BasicRPC.getHello();
```

### BasicRPC.postHello

> Post a greeting

Post a greeting to the server

`POST https://examples.vovk.dev/api/basic/greeting`

```ts
import { BasicRPC } from 'vovk-examples';

const response = await BasicRPC.postHello();
```

## BasicRPCWithService

### BasicRPCWithService.getHello

> Get a greeting using a service

Get a greeting from the server using a service

`GET https://examples.vovk.dev/api/basic-with-service/greeting`

```ts
import { BasicRPCWithService } from 'vovk-examples';

const response = await BasicRPCWithService.getHello();
```

## JSONLinesRPC

### JSONLinesRPC.streamTokens

> Stream tokens

Stream tokens to the client

`GET https://examples.vovk.dev/api/jsonlines/tokens`

```ts
import { JSONLinesRPC } from 'vovk-examples';

using response = await JSONLinesRPC.streamTokens();

for await (const item of response) {
  console.log(item);
  /*
    {
        message: "string"
    }
    */
}
```

## JSONLinesResponderRPC

### JSONLinesResponderRPC.streamTokens

> Stream tokens using Response object

Stream tokens to the client using Response object

`GET https://examples.vovk.dev/api/jsonlines-responder/tokens`

```ts
import { JSONLinesResponderRPC } from 'vovk-examples';

using response = await JSONLinesResponderRPC.streamTokens();

for await (const item of response) {
  console.log(item);
  /*
    {
        message: "string"
    }
    */
}
```

## OpenAiRPC

### OpenAiRPC.createChatCompletion

> Create a chat completion

Create a chat completion using OpenAI and yield the response

`POST https://examples.vovk.dev/api/openai/chat`

```ts
import { OpenAiRPC } from 'vovk-examples';

const response = await OpenAiRPC.createChatCompletion();
```

## AiSdkRPC

### AiSdkRPC.chat

> Vercel AI SDK

Uses [@ai-sdk/openai](https://www.npmjs.com/package/@ai-sdk/openai) and ai packages to chat with an AI model

`POST https://examples.vovk.dev/api/ai-sdk/chat`

```ts
import { AiSdkRPC } from 'vovk-examples';

const response = await AiSdkRPC.chat();
```

## ProxyRPC

### ProxyRPC.getHello

> Proxy procedure

Get a greeting from vovk.dev

`GET https://examples.vovk.dev/api/proxy/greeting`

```ts
import { ProxyRPC } from 'vovk-examples';

const response = await ProxyRPC.getHello();
```

## PollRPC

### PollRPC.streamPollResponse

`GET https://examples.vovk.dev/api/polling`

```ts
import { PollRPC } from 'vovk-examples';

using response = await PollRPC.streamPollResponse({
  query: {
    i: 'string',
  },
});

for await (const item of response) {
  console.log(item);
  /*
    {
        i: 0
    }
    */
}
```

## EventsRPC

### EventsRPC.streamEvents

`GET https://examples.vovk.dev/api/events`

```ts
import { EventsRPC } from 'vovk-examples';

using response = await EventsRPC.streamEvents();

for await (const item of response) {
  console.log(item);
  /*
    {
        // Event name
        event: "foo",
        payload: {
            // Event timestamp
            timestamp: "2023-01-01T00:00:00Z",
            // Event message
            message: "string"
        }
    }
    */
}
```

## ProgressiveRPC

### ProgressiveRPC.streamProgressiveResponse

`GET https://examples.vovk.dev/api/progressive`

```ts
import { ProgressiveRPC } from 'vovk-examples';

using response = await ProgressiveRPC.streamProgressiveResponse();

for await (const item of response) {
  console.log(item);
  /*
    {
        users: [
            {
                id: 0,
                name: "string"
            }
        ]
    }
    */
}
```

## FormZodRPC

### FormZodRPC.submitForm

> Submit form (Zod)

Submit form with Zod validation

`POST https://examples.vovk.dev/api/form-zod/{id}`

```ts
import { FormZodRPC } from 'vovk-examples';

const formData = new FormData();
// User email
formData.append('email', 'user@example.com');
// Resume file
formData.append('resume', new Blob([binary_data]));
// Portfolio samples
formData.append('portfolioSamples', new Blob([binary_data]));
// Portfolio samples
formData.append('portfolioSamples', new Blob([binary_data]));

const response = await FormZodRPC.submitForm({
  body: formData,
  params: {
    // User ID
    id: '00000000-0000-0000-0000-000000000000',
  },
});

console.log(response);
/* 
{
    // -----
    // Response object
    // -----
    // User email
    email: "user@example.com",
    resume: {
        // Resume file name
        name: "resume.pdf",
        // Resume file size
        size: 0,
        // Resume file type
        type: "application/pdf"
    },
    // Array of portfolio sample files
    portfolioSamples: [
        {
            // Portfolio sample file name
            name: "portfolio.zip",
            // Portfolio sample file size
            size: 0,
            // Portfolio sample file type
            type: "application/zip"
        }
    ]
}
*/
```

## OpenApiRPC

### OpenApiRPC.getSpec

> OpenAPI spec

Get the OpenAPI spec for the examples API

`GET https://examples.vovk.dev/api/static/openapi.json`

```ts
import { OpenApiRPC } from 'vovk-examples';

const response = await OpenApiRPC.getSpec();
```

## StaticParamsRPC

### StaticParamsRPC.getStaticParams

> Static Params

Get the static params: section and page

`GET https://examples.vovk.dev/api/static/static-params/{section}/page{page}.json`

```ts
import { StaticParamsRPC } from 'vovk-examples';

const response = await StaticParamsRPC.getStaticParams({
  params: {
    section: 'a',
    page: '1',
  },
});
```
