> ## Documentation Index
> Fetch the complete documentation index at: https://forst-lang.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Call Forst backend functions from JavaScript and TypeScript applications.

JavaScript backends often need three things when adopting Forst: **generated client types**, **calling Forst functions over HTTP**, and **testing and security controls**.

<Note>
  Install `@forst/cli` first. Add a `postinstall` script that runs `forst generate .`.
  Run generate once before you import `@forst/gen`.
  Details are on the [Installation](/docs/installation#generated-typescript-client) page.
</Note>

```typescript theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/languages/forst.json"]}}
import { $auth } from "@forst/gen/auth";

const { valid } = await $auth.VerifyPassword({
  plainPassword: "secret",
  passwordHash: "$2a$...",
});
```

```mermaid theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/languages/forst.json"]}}
flowchart LR
  subgraph nodePath [JavaScript migration]
    GenTypes["forst generate"]
    NodeToForst["JS calls Forst"]
    ForstToJS["Forst calls JavaScript"]
  end

  GenTypes -.->|"@forst/gen"| NodeToForst
  NodeToForst -->|"POST /invoke"| ForstBinary[Compiled Forst]
  ForstToJS -->|"import ./path js"| LegacyJS["legacy .ts / .js"]
```

## Start here

| Goal                                                            | Guide                                                          |
| --------------------------------------------------------------- | -------------------------------------------------------------- |
| Get a typed client into your app                                | [Generate a TypeScript client](/docs/interop/invoke/generate-types) |
| Call Forst functions from Express, Remix, or scripts            | [Call Forst over HTTP](/docs/interop/invoke/call-forst)             |
| Secure the local invoke socket and process boundary             | [Invoke security](/docs/interop/invoke/security)                    |
| Stub Forst in unit or integration tests                         | [Testing](/docs/interop/invoke/testing)                             |
| Use Effect with generated clients                               | [Effect mode](/docs/interop/invoke/effect)                          |
| Call legacy JavaScript from compiled Forst (opposite direction) | [Call JavaScript from Forst](/docs/interop/bridge)                  |

## Related

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/docs/installation#generated-typescript-client">
    `@forst/cli`, `postinstall`, and first generate.
  </Card>

  <Card title="Mix with Go packages" icon="golang" href="/docs/interop/go">
    Forst compiles to Go — import stdlib and third-party packages.
  </Card>

  <Card title="Dev server" icon="server" href="/docs/workflow/dev-server">
    `forst dev` HTTP contract for local iteration.
  </Card>
</CardGroup>
