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

# Migrating to autumn-js 1.6

> autumn-js 1.6 is ESM-only and removes the React hooks, framework handlers and better-auth plugin

autumn-js 1.6 is ESM-only and server-side. The `Autumn` class and every API call keep the same shape. It removes the client-side and framework entries that were deprecated in 1.5, because a browser client could modify the requests they proxied.

## What changed

| Removed in 1.6 | Use instead |
| - | - |
| `autumn-js/react` (`AutumnProvider`, `useCustomer`, `useEntity`, `useListPlans` and the other hooks) | Call Autumn from your own server routes and fetch those routes from your frontend |
| `autumn-js/backend`, `/express`, `/fetch`, `/hono`, `/next` (`autumnHandler`) | Call the SDK directly in your route handlers, with the customer ID from your own session |
| `autumn-js/better-auth` (the `autumn()` plugin) | Call the SDK from your server with the customer ID from the better-auth session |
| CommonJS (`require("autumn-js")`) | `import`. Node 20.19+ and 22.12+ can also `require()` the ES module |

## Recommended: AutumnCore and standalone functions

`autumn-js/core` and `autumn-js/funcs/<name>` load only the models the calls you use need. Importing `AutumnCore` and `check` retains about 4 MB of heap, compared with about 25 MB for the `Autumn` class.

```typescript theme={null}
import { AutumnCore } from "autumn-js/core";
import { check } from "autumn-js/funcs/check";

const autumn = new AutumnCore({ secretKey: process.env.AUTUMN_SECRET_KEY });

export async function POST(request: Request) {
  const customerId = await getCustomerIdFromSession(request);
  const { featureId } = await request.json();
  const result = await check(autumn, { customerId, featureId });
  if (!result.ok) return Response.json({ error: result.error.message }, { status: 500 });
  return Response.json(result.value);
}
```

Function names follow the class methods: `autumn.customers.getOrCreate(...)` becomes `customersGetOrCreate(autumn, ...)` from `autumn-js/funcs/customers-get-or-create`. Standalone functions return a `Result` instead of throwing. Check `result.error` against the error classes exported by `autumn-js/core`.

To route edge-served calls such as `check` through the [edge cache](https://docs.useautumn.com/documentation/edge-cache.md), pass `useEdge: true` and your `edgeURL` to `AutumnCore`, as `autumn.edge` does on the `Autumn` class.

## Staying on 1.5

autumn-js 1.5.x keeps every removed entry, in both CommonJS and ESM. Pin `autumn-js@~1.5` if you can't migrate yet.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.