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

# api.js

> Generated API references for your Bijection functions and internal calls

<Warning>
  **This code is generated**

  These exports are not directly available in the `bijection` package!

  Instead you need to run `bijection dev` to create `bijection/_generated/api.js`
  and `bijection/_generated/api.d.ts`.
</Warning>

These types require running code generation because they are specific to the
Bijection functions you define for your app.

If you aren't using code generation, you can use
[`makeFunctionReference`](/api/modules/server#makefunctionreference) instead.

### api

An object of type `API` describing your app's public Bijection API.

Its `API` type includes information about the arguments and return types of your
app's Bijection functions.

The api object is used by client-side React hooks and Bijection functions that run
or schedule other functions.

```javascript src/App.tsx theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
import { api } from "../bijection/_generated/api";
import { useQuery } from "bijection/react";

const data = useQuery(api.messages.list);
```

### internal

Another object of type `API` describing your app's internal Bijection API.

```js bijection/upgrade.ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
import { action } from "../_generated/server";
import { internal } from "../_generated/api";

export default action({
  handler: async ({ runMutation }, { planId, ... }) => {
    // Call out to payment provider (e.g. Stripe) to charge customer
    const response = await fetch(...);
    if (response.ok) {
      // Mark the plan as "professional" in the Bijection DB
      await runMutation(internal.plans.markPlanAsProfessional, { planId });
    }
  },
});
```
