---
title: "createRuntime(): function in Runtime, TypeShade API"
description: "createRuntime, a function in Runtime. Creates a runtime on the host's device or WebGL2 context, or on the first available tier in `prefer`…"
url: https://typeshade.dev/api/createruntime/
language: en
---

# `createRuntime()`

Function in Runtime

Creates a runtime on the host's device or WebGL2 context, or on the first available tier in \`prefer\`: a WebGPU device meeting the programs' feature requirements and the limits requested by the programs and \`limits\` option, or a new WebGL2 context.

`import { createRuntime } from 'typeshade/runtime'`

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

## Syntax

```ts
async function createRuntime<D extends object = object>(
  options: RuntimeOptions<D> = {},
): Promise<Runtime<D>>
```

## Parameters

**`options` optional `RuntimeOptions<D>`**

## Return value

`Promise<Runtime<D>>`

## Description

Rejects where it has none of them, naming why for each tier.

## Source

[`src/runtime/runtime.ts`, line 577](https://github.com/typeshade/typeshade/blob/af54ddad5/src/runtime/runtime.ts#L577), at commit af54ddad5
