The `@authdog/remix-node` SDK integrates Authdog with Remix: a client provider plus server loaders that resolve the session and exchange the sign-in token into HttpOnly cookies. It reads the [session](/docs/concepts/sessions-tokens) Authdog issues.

## Install

```bash
npm install @authdog/remix-node
```

Requires `@remix-run/node` `^2.15`+ and React 18 or 19. Set `PK_AUTHDOG` (your `pk_...` key) on the server.

## Wrap the app

`AuthdogProvider` and `ReloadPage` capture the `?token=` from the sign-in redirect, let the server set HttpOnly cookies, and strip the token from the URL:

```tsx
// app/root.tsx
import { AuthdogProvider, ReloadPage } from "@authdog/remix-node/client"

export default function App() {
  return (
    <AuthdogProvider>
      <Outlet />
      <Scripts />
      <ReloadPage />
    </AuthdogProvider>
  )
}
```

## Resolve the session in a loader

`identityLoader()` returns a Remix loader that verifies the session server-side and returns `{ user }` — the enforcement point:

```tsx
// app/routes/profile.tsx
import { useLoaderData } from "@remix-run/react"
import { identityLoader } from "@authdog/remix-node"

export const loader = identityLoader()

export default function Profile() {
  const { user } = useLoaderData<typeof loader>()
  return <UserProfile user={user} loading={false} />
}
```

## Sign out

Wire a route to `logoutLoader`, which clears the session and redirects:

```ts
// app/routes/logout.ts
import { logoutLoader } from "@authdog/remix-node"
export const loader = logoutLoader
```

Pair the loader-resolved session with your [authorization](/docs/concepts/authorization) model to decide what a user may do.

## Next steps

- [Component reference](/docs/components) — the `@authdog/react-elements` UI (e.g. `UserProfile`).
- [Backend requests](/docs/backend) — the verification model, in depth.
- [Quickstarts](/docs/quickstarts) — the five-minute path.
