---
title: "Output"
description: "Learn about files generated with @hey-api/openapi-ts."
url: "https://heyapi.dev/docs/openapi/typescript/output"
---

Every generated file in your output folder is created by a plugin. This page describes the default output, but similar logic applies to all plugins.

## Overview

[Section titled “Overview”](#overview)

If you use the default configuration, your [project](https://stackblitz.com/edit/hey-api-example?file=openapi-ts.config.ts,src%2Fclient%2Fschemas.gen.ts,src%2Fclient%2Fsdk.gen.ts,src%2Fclient%2Ftypes.gen.ts) might look like this.

* my-app/

  * node\_modules/

    * …

  * src/

    * client/

      * client/

        * …

      * core/

        * …

      * client.gen.ts

      * index.ts

      * sdk.gen.ts

      * types.gen.ts

    * index.ts

  * package.json

Your actual output depends on your Hey API configuration. It may contain a different number of files and their contents might differ.

Let’s go through each file in the `src/client` folder and explain what it looks like, what it does, and how to use it.

## Client

[Section titled “Client”](#client)

`client.gen.ts` is generated by [client plugins](https://heyapi.dev/openapi-ts/clients). If you choose to generate SDKs (enabled by default), we use the Fetch client unless specified otherwise.

client.gen.ts

```ts
import { createClient, createConfig } from './client';


export const client = createClient(createConfig());
```

The contents of this file are consumed by SDKs, but you can also import `client` in your application to perform additional configuration or send manual requests.

### Bundle

[Section titled “Bundle”](#bundle)

Client plugins provide their bundles inside `client` and `core` folders. The contents of these folders don’t depend on the provided input. Everything inside these folders serves as a scaffolding so the generated code can make HTTP requests.

## TypeScript

[Section titled “TypeScript”](#typescript)

You can learn more on the [TypeScript](https://heyapi.dev/openapi-ts/plugins/typescript) page.

## SDK

[Section titled “SDK”](#sdk)

You can learn more on the [SDK](https://heyapi.dev/openapi-ts/plugins/sdk) page.

## Entry File

[Section titled “Entry File”](#entry-file)

`index.ts` is not generated by any specific plugin. It’s meant for convenience and by default, it re-exports every artifact generated by default plugins (TypeScript and SDK).

index.ts

```ts
export * from './sdk.gen';
export * from './types.gen';
```

### Disable entry file

[Section titled “Disable entry file”](#disable-entry-file)

We recommend importing artifacts from their respective files to avoid ambiguity, but we leave this choice up to you.

index.ts

```ts
import type { Pet } from './client';
// or
import type { Pet } from './client/types.gen';
```

If you’re not importing artifacts from the entry file, you can skip generating it altogether by setting the `output.entryFile` option to `false`.

openapi-ts.config.ts

```js
export default {
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: {
    entryFile: false,
    path: 'src/client',
  },
};
```

### Re-export artifacts

[Section titled “Re-export artifacts”](#re-export-artifacts)

You can choose which artifacts should be re-exported from the entry file using the `includeInEntry` option on any plugin. For example, we can re-export all [Zod](https://heyapi.dev/openapi-ts/plugins/zod) plugin artifacts by setting `includeInEntry` to `true`:

* example

  index.ts

  ```ts
  export {
    zAddPetData,
    zAddPetResponse,
    zApiResponse,
    zCategory,
    // ...more exports
  } from './zod.gen';
  ```

* config

  openapi-ts.config.ts

  ```js
  export default {
    input: 'hey-api/backend', // sign up at app.heyapi.dev
    output: 'src/client',
    plugins: [
      // ...other plugins
      {
        includeInEntry: true,
        name: 'zod',
      },
    ],
  };
  ```

Or we can re-export only specific artifacts by providing a predicate function:

* example

  index.ts

  ```ts
  export { zTag } from './zod.gen';
  ```

* config

  openapi-ts.config.ts

  ```js
  export default {
    input: 'hey-api/backend', // sign up at app.heyapi.dev
    output: 'src/client',
    plugins: [
      // ...other plugins
      {
        includeInEntry: (symbol) => symbol.name === 'zTag',
        name: 'zod',
      },
    ],
  };
  ```

## Examples

You can view live examples on [StackBlitz](https://stackblitz.com/orgs/github/hey-api/collections/openapi-ts-examples) or on [GitHub](https://github.com/hey-api/openapi-ts/tree/main/examples).
